Commit 8a8ed262 authored by Nicola Gatto's avatar Nicola Gatto

Adjust tests

parent cdc08ba5
...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock): ...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock):
with self.name_scope(): with self.name_scope():
if not data_mean is None: if not data_mean is None:
assert(not data_std is None) assert(not data_std is None)
self.input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std) self.image_input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std)
else: else:
self.input_normalization = NoNormalization() self.image_input_normalization = NoNormalization()
self.conv1_ = gluon.nn.Conv2D(channels=20, self.conv1_ = gluon.nn.Conv2D(channels=20,
kernel_size=(5,5), kernel_size=(5,5),
...@@ -112,8 +112,8 @@ class Net(gluon.HybridBlock): ...@@ -112,8 +112,8 @@ class Net(gluon.HybridBlock):
self.last_layer = 'softmax' self.last_layer = 'softmax'
def hybrid_forward(self, F, x): def hybrid_forward(self, F, image):
image = self.input_normalization(x) image = self.image_input_normalization(image)
conv1_ = self.conv1_(image) conv1_ = self.conv1_(image)
pool1_ = self.pool1_(conv1_) pool1_ = self.pool1_(conv1_)
conv2_ = self.conv2_(pool1_) conv2_ = self.conv2_(pool1_)
......
...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock): ...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock):
with self.name_scope(): with self.name_scope():
if not data_mean is None: if not data_mean is None:
assert(not data_std is None) assert(not data_std is None)
self.input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std) self.state_input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std)
else: else:
self.input_normalization = NoNormalization() self.state_input_normalization = NoNormalization()
self.fc1_ = gluon.nn.Dense(units=128, use_bias=True) self.fc1_ = gluon.nn.Dense(units=128, use_bias=True)
# fc1_, output shape: {[128,1,1]} # fc1_, output shape: {[128,1,1]}
...@@ -93,8 +93,8 @@ class Net(gluon.HybridBlock): ...@@ -93,8 +93,8 @@ class Net(gluon.HybridBlock):
self.last_layer = 'linear' self.last_layer = 'linear'
def hybrid_forward(self, F, x): def hybrid_forward(self, F, state):
state = self.input_normalization(x) state = self.state_input_normalization(state)
fc1_ = self.fc1_(state) fc1_ = self.fc1_(state)
tanh1_ = self.tanh1_(fc1_) tanh1_ = self.tanh1_(fc1_)
fc2_ = self.fc2_(tanh1_) fc2_ = self.fc2_(tanh1_)
......
...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock): ...@@ -74,9 +74,9 @@ class Net(gluon.HybridBlock):
with self.name_scope(): with self.name_scope():
if not data_mean is None: if not data_mean is None:
assert(not data_std is None) assert(not data_std is None)
self.input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std) self.state_input_normalization = ZScoreNormalization(data_mean=data_mean, data_std=data_std)
else: else:
self.input_normalization = NoNormalization() self.state_input_normalization = NoNormalization()
self.fc1_ = gluon.nn.Dense(units=512, use_bias=True) self.fc1_ = gluon.nn.Dense(units=512, use_bias=True)
# fc1_, output shape: {[512,1,1]} # fc1_, output shape: {[512,1,1]}
...@@ -93,8 +93,8 @@ class Net(gluon.HybridBlock): ...@@ -93,8 +93,8 @@ class Net(gluon.HybridBlock):
self.last_layer = 'linear' self.last_layer = 'linear'
def hybrid_forward(self, F, x): def hybrid_forward(self, F, state):
state = self.input_normalization(x) state = self.state_input_normalization(state)
fc1_ = self.fc1_(state) fc1_ = self.fc1_(state)
tanh1_ = self.tanh1_(fc1_) tanh1_ = self.tanh1_(fc1_)
fc2_ = self.fc2_(tanh1_) fc2_ = self.fc2_(tanh1_)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment