Skip to content

Commit 836a81e

Browse files
committed
Change layers.Add interface.
1 parent 4174b55 commit 836a81e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/TensorFlowNET.Examples/ImageProcessing/ToyResNet.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ limitations under the License.
1515
******************************************************************************/
1616

1717
using NumSharp;
18+
using Tensorflow;
1819
using Tensorflow.Keras.Engine;
1920
using Tensorflow.Keras.Utils;
2021
using static Tensorflow.Binding;
@@ -56,16 +57,16 @@ public override void BuildModel()
5657
var x = layers.Conv2D(32, 3, activation: "relu").Apply(inputs);
5758
x = layers.Conv2D(64, 3, activation: "relu").Apply(x);
5859

59-
x = layers.BatchNormalization().Apply(x);
60+
// x = layers.BatchNormalization().Apply(x);
6061
var block_1_output = layers.MaxPooling2D(3).Apply(x);
6162

6263
x = layers.Conv2D(64, 3, activation: "relu", padding: "same").Apply(block_1_output);
6364
x = layers.Conv2D(64, 3, activation: "relu", padding: "same").Apply(x);
64-
var block_2_output = layers.add(x, block_1_output);
65+
var block_2_output = layers.Add().Apply(new Tensors(x, block_1_output));
6566

6667
x = layers.Conv2D(64, 3, activation: "relu", padding: "same").Apply(block_2_output);
6768
x = layers.Conv2D(64, 3, activation: "relu", padding: "same").Apply(x);
68-
var block_3_output = layers.add(x, block_2_output);
69+
var block_3_output = layers.Add().Apply(new Tensors(x, block_2_output));
6970

7071
x = layers.Conv2D(64, 3, activation: "relu").Apply(block_3_output);
7172
x = layers.GlobalAveragePooling2D().Apply(x);

0 commit comments

Comments
 (0)