Skip to content

Commit

Permalink
square kernal conv block in inceptionv3
Browse files Browse the repository at this point in the history
  • Loading branch information
syt123450 committed Nov 20, 2018
1 parent a10dc3f commit 9f864e9
Show file tree
Hide file tree
Showing 6 changed files with 279 additions and 3 deletions.
Binary file removed examples/inceptionv3/inceptionModel/group1-shard1of1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/inceptionv3/inceptionModel/model.json

Large diffs are not rendered by default.

280 changes: 278 additions & 2 deletions examples/inceptionv3/inceptionv3.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@

max_pooling2d_2.apply( conv2d_5 );

// block 1

let conv2d_9 = new TSP.layers.Conv2d({

kernelSize: 1,
Expand Down Expand Up @@ -224,12 +226,286 @@
name: "mixed0"
});

// block 2

let conv2d_16 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_16"

});

conv2d_16.apply( mixed0 );

let conv2d_17 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 1,
padding: "same",
name: "conv2d_17"

});

conv2d_17.apply( conv2d_16 );

let conv2d_18 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 1,
padding: "same",
name: "conv2d_18"

});

conv2d_18.apply( conv2d_17 );

let conv2d_14 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 48,
strides: 1,
padding: "same",
name: "conv2d_14"

});

conv2d_14.apply( mixed0 );

let conv2d_15 = new TSP.layers.Conv2d({

kernelSize: 5,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_15"

});

conv2d_15.apply( conv2d_14 );

let average_pooling2d_2 = new TSP.layers.Pooling2d( {

poolSize: [ 3, 3 ],
strides: [ 1, 1 ],
padding: "same",
name: "average_pooling2d_2"

} );

average_pooling2d_2.apply( mixed0 );

let conv2d_19 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_19"

});

conv2d_19.apply( average_pooling2d_2 );

let conv2d_13 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_13"

});

conv2d_13.apply( mixed0 );

let mixed1 = new TSP.layers.Concatenate([ conv2d_18, conv2d_15, conv2d_19, conv2d_13 ], {
name: "mixed1"
});

// block 3

let conv2d_23 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_23"

});

conv2d_23.apply( mixed1 );

let conv2d_24 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 1,
padding: "same",
name: "conv2d_24"

});

conv2d_24.apply( conv2d_23 );

let conv2d_25 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 1,
padding: "same",
name: "conv2d_25"

});

conv2d_25.apply( conv2d_24 );

let conv2d_21 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 48,
strides: 1,
padding: "same",
name: "conv2d_21"

});

conv2d_21.apply( mixed1 );

let conv2d_22 = new TSP.layers.Conv2d({

kernelSize: 5,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_22"

});

conv2d_22.apply( conv2d_21 );

let average_pooling2d_3 = new TSP.layers.Pooling2d( {

poolSize: [ 3, 3 ],
strides: [ 1, 1 ],
padding: "same",
name: "average_pooling2d_3"

} );

average_pooling2d_3.apply( mixed1 );

let conv2d_26 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_26"

});

conv2d_26.apply( average_pooling2d_3 );

let conv2d_20 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_20"

});

conv2d_20.apply( mixed1 );

let mixed2 = new TSP.layers.Concatenate([ conv2d_25, conv2d_22, conv2d_26, conv2d_20 ], {
name: "mixed2"
});

// block 4

let conv2d_28 = new TSP.layers.Conv2d({

kernelSize: 1,
filters: 64,
strides: 1,
padding: "same",
name: "conv2d_28"

});

conv2d_28.apply( mixed2 );

let conv2d_29 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 1,
padding: "same",
name: "conv2d_29"

});

conv2d_29.apply( conv2d_28 );

let conv2d_30 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 96,
strides: 2,
padding: "valid",
name: "conv2d_30"

});

conv2d_30.apply( conv2d_29 );

let conv2d_27 = new TSP.layers.Conv2d({

kernelSize: 3,
filters: 384,
strides: 2,
padding: "valid",
name: "conv2d_27"

});

conv2d_27.apply( mixed2 );

let max_pooling2d_3 = new TSP.layers.Pooling2d( {

poolSize: [ 3, 3 ],
strides: [ 2, 2 ],
padding: "valid",
name: "max_pooling2d_3"

} );

max_pooling2d_3.apply( mixed2 );

let mixed3 = new TSP.layers.Concatenate([ conv2d_30, conv2d_27, max_pooling2d_3 ], {
name: "mixed3"
});

let model = new TSP.models.Model( modelContainer, {

inputs: [input],
outputs: [mixed0],
outputs: [mixed3],
outputsOrder: ["conv2d_1", "conv2d_2", "conv2d_3", "max_pooling2d_1", "conv2d_4", "conv2d_5", "max_pooling2d_2",
"conv2d_9", "conv2d_10", "conv2d_11", "conv2d_7", "conv2d_8", "average_pooling2d_1", "conv2d_12", "conv2d_6", "mixed0"]
// block 1
"conv2d_9", "conv2d_10", "conv2d_11", "conv2d_7", "conv2d_8", "average_pooling2d_1", "conv2d_12", "conv2d_6", "mixed0",
// block 2
"conv2d_16", "conv2d_17", "conv2d_18", "conv2d_14", "conv2d_15", "average_pooling2d_2", "conv2d_19", "conv2d_13", "mixed1",
// block 3
"conv2d_23", "conv2d_24", "conv2d_25", "conv2d_21", "conv2d_22", "average_pooling2d_3", "conv2d_26", "conv2d_20", "mixed2",
// block 4
"conv2d_28", "conv2d_29", "conv2d_30", "conv2d_27", "max_pooling2d_3", "mixed3"]

} );

Expand Down

0 comments on commit 9f864e9

Please sign in to comment.