Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
Merge pull request #628 from lukeyeager/layer-stages
Browse files Browse the repository at this point in the history
Use layer stages for all-in-one nets
  • Loading branch information
lukeyeager committed Mar 15, 2016
2 parents 41996c8 + a5eba04 commit 4bd5b9e
Show file tree
Hide file tree
Showing 8 changed files with 503 additions and 181 deletions.
45 changes: 35 additions & 10 deletions digits/model/images/classification/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,22 @@ class BaseViewsTest(digits.test_views.BaseViewsTest):
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
layer {
name: "accuracy"
type: "Accuracy"
bottom: "output"
bottom: "label"
top: "accuracy"
include {
phase: TEST
}
include { stage: "val" }
}
layer {
name: "softmax"
type: "Softmax"
bottom: "output"
top: "softmax"
include { stage: "deploy" }
}
"""

Expand Down Expand Up @@ -431,6 +437,14 @@ def test_bad_network_definition(self):
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
layer {
name: "softmax"
type: "Softmax"
bottom: "output"
top: "softmax"
include { stage: "deploy" }
}
"""
elif self.FRAMEWORK == 'torch':
Expand Down Expand Up @@ -839,16 +853,22 @@ class BaseTestCreatedCropInNetwork(BaseTestCreated):
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
layer {
name: "accuracy"
type: "Accuracy"
bottom: "output"
bottom: "label"
top: "accuracy"
include {
phase: TEST
}
include { stage: "val" }
}
layer {
name: "softmax"
type: "Softmax"
bottom: "output"
top: "softmax"
include { stage: "deploy" }
}
"""
TORCH_NETWORK = \
Expand Down Expand Up @@ -1006,16 +1026,15 @@ class TestPythonLayer(BaseViewsTestWithDataset):
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
layer {
name: "accuracy"
type: "Accuracy"
bottom: "output"
bottom: "label"
top: "accuracy"
include {
phase: TEST
}
include { stage: "val" }
}
layer {
name: "py_test"
Expand All @@ -1027,7 +1046,13 @@ class TestPythonLayer(BaseViewsTestWithDataset):
layer: "PythonLayer"
}
}
layer {
name: "softmax"
type: "Softmax"
bottom: "output"
top: "softmax"
include { stage: "deploy" }
}
"""
def write_python_layer_script(self, filename):
with open(filename, 'w') as f:
Expand Down
6 changes: 4 additions & 2 deletions digits/model/images/generic/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ class BaseViewsTest(digits.test_views.BaseViewsTest):
}
}
layer {
name: "train_loss"
name: "loss"
type: "EuclideanLoss"
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
"""

Expand Down Expand Up @@ -711,11 +712,12 @@ class BaseTestCreatedCropInNetwork(BaseTestCreated):
}
}
layer {
name: "train_loss"
name: "loss"
type: "EuclideanLoss"
bottom: "output"
bottom: "label"
top: "loss"
exclude { stage: "deploy" }
}
"""

Expand Down
Loading

0 comments on commit 4bd5b9e

Please sign in to comment.