Skip to content

Commit

Permalink
Added support for variable arguments in nn importer. Fixes #328 (#329)
Browse files Browse the repository at this point in the history
WIP #328 Renamed arg to 'params'. Fixed eslint issues

WIP #328 Updated nn layers.json

WIP #328 Added ReLU6 layer

WIP #328 Updated seeds
  • Loading branch information
JimnyCricket authored and brollb committed Jun 21, 2016
1 parent ec8fcb2 commit a3ff6cf
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
78 changes: 69 additions & 9 deletions src/common/layers.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
{
"name": "CMul",
"baseType": "Module",
"params": [],
"params": [
"params"
],
"type": "Simple",
"setters": []
},
Expand Down Expand Up @@ -285,7 +287,9 @@
{
"name": "GradientReversal",
"baseType": "Module",
"params": [],
"params": [
"lambda"
],
"type": "Misc",
"setters": []
},
Expand All @@ -303,7 +307,8 @@
"baseType": "Module",
"params": [
"min_value",
"max_value"
"max_value",
"inplace"
],
"type": "Transfer",
"setters": []
Expand Down Expand Up @@ -394,9 +399,7 @@
{
"name": "Log",
"baseType": "Module",
"params": [
"inputSize"
],
"params": [],
"type": "Misc",
"setters": []
},
Expand Down Expand Up @@ -698,6 +701,15 @@
"type": "Transfer",
"setters": []
},
{
"name": "ReLU6",
"baseType": "Module",
"params": [
"inplace"
],
"type": "Transfer",
"setters": []
},
{
"name": "Replicate",
"baseType": "Module",
Expand All @@ -712,7 +724,9 @@
{
"name": "Reshape",
"baseType": "Module",
"params": [],
"params": [
"params"
],
"type": "Simple",
"setters": []
},
Expand Down Expand Up @@ -844,6 +858,16 @@
"type": "Convolution",
"setters": []
},
{
"name": "SpatialClassNLLCriterion",
"baseType": "Criterion",
"params": [
"weights",
"sizeAverage"
],
"type": "Criterion",
"setters": []
},
{
"name": "SpatialContrastiveNormalization",
"baseType": "Module",
Expand Down Expand Up @@ -931,6 +955,24 @@
"type": "Convolution",
"setters": []
},
{
"name": "SpatialDilatedConvolution",
"baseType": "SpatialConvolution",
"params": [
"nInputPlane",
"nOutputPlane",
"kW",
"kH",
"dW",
"dH",
"padW",
"padH",
"dilationH",
"dilationW"
],
"type": "Convolution",
"setters": []
},
{
"name": "SpatialDivisiveNormalization",
"baseType": "Module",
Expand Down Expand Up @@ -1217,7 +1259,9 @@
{
"name": "Transpose",
"baseType": "Module",
"params": [],
"params": [
"params"
],
"type": "Misc",
"setters": []
},
Expand All @@ -1234,7 +1278,9 @@
{
"name": "View",
"baseType": "Module",
"params": [],
"params": [
"params"
],
"type": "Simple",
"setters": []
},
Expand Down Expand Up @@ -1340,6 +1386,20 @@
"type": "Convolution",
"setters": []
},
{
"name": "VolumetricReplicationPadding",
"baseType": "Module",
"params": [
"pleft",
"pright",
"ptop",
"pbottom",
"pfront",
"pback"
],
"type": "Misc",
"setters": []
},
{
"name": "WeightedEuclidean",
"baseType": "Module",
Expand Down
Binary file modified src/seeds/cifar10/cifar10.webgmex
Binary file not shown.
Binary file modified src/seeds/nn/nn.webgmex
Binary file not shown.
Binary file modified src/seeds/project/project.webgmex
Binary file not shown.
1 change: 1 addition & 0 deletions utils/categories.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"Sigmoid",
"Tanh",
"ReLU",
"ReLU6",
"PReLU",
"RReLU",
"LeakyReLU"
Expand Down
3 changes: 3 additions & 0 deletions utils/nn-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ var findInitParams = function(ast){
ast.block.stats.forEach(function(block){
if(block.key && block.key.val == '__init' && block.func){
params = block.func.args;
if(params.length === 0 && block.func.varargs){
params[0] = 'params';
}
}
});
return params;
Expand Down

0 comments on commit a3ff6cf

Please sign in to comment.