Skip to content

Commit

Permalink
WIP #541 Fixed utils tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Jul 27, 2016
1 parent c9b7fd6 commit bd4a5f7
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 5 deletions.
Binary file modified src/seeds/nn/nn.webgmex
Binary file not shown.
77 changes: 77 additions & 0 deletions test/test-cases/models/concat-parallel-utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
- type: Linear
id: /l/1
next:
- /l/s
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 50
- type: Reshape
id: /l/8
next:
- /l/i
- /l/D
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
dimensions: 100
- type: Tanh
id: /l/9
next:
- /l/k
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /l/D
next:
- /l/9
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 150
- type: Tanh
id: /l/X
next:
- /l/a
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /l/a
next: []
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 7
- type: Tanh
id: /l/f
next:
- /l/1
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /l/i
next:
- /l/f
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 150
- type: Linear
id: /l/k
next:
- /l/s
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 30
- type: Concat
id: /l/s
next:
- /l/X
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
dim: 1
68 changes: 68 additions & 0 deletions test/test-cases/models/concat-y-utils.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
- type: Linear
id: /Z/1
next:
- /Z/E
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 30
- type: Tanh
id: /Z/3
next:
- /Z/a
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /Z/7
next:
- /Z/o
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 150
- type: Concat
id: /Z/E
next:
- /Z/M
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
dim: 1
- type: Tanh
id: /Z/M
next:
- /Z/n
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /Z/a
next:
- /Z/E
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 50
- type: Linear
id: /Z/n
next: []
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 7
- type: Tanh
id: /Z/o
next:
- /Z/1
attributes:
calculateDimensionality: 'function calcDims(layer) return 1; --[[ return output dimensions --]] end'
dimensionalityTransform: same
- type: Linear
id: /Z/t
next:
- /Z/3
attributes:
calculateDimensionality: function calcDims(layer) return layer.output; end
dimensionalityTransform: custom
output: 150
10 changes: 5 additions & 5 deletions test/utils/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ describe('utils', function () {

describe('matching architectures', function() {
var cases = [
['/l', 'concat-parallel'],
['/Z', 'concat-y'],
['/l', 'concat-parallel-utils'],
['/Z', 'concat-y-utils'],
['/y', 'concat-y-bad-conn'] // disconnected graph
];

Expand All @@ -117,9 +117,9 @@ describe('utils', function () {

describe('mismatching architectures', function() {
var cases = [
['/l', 'concat-y'],
['/y', 'concat-parallel'],
['/s', 'concat-y']
['/l', 'concat-y-utils'],
['/y', 'concat-parallel-utils'],
['/s', 'concat-y-utils']
];

cases.forEach(pair => it('should NOT validate ' + pair[1],
Expand Down

0 comments on commit bd4a5f7

Please sign in to comment.