Skip to content

Commit

Permalink
batch_size to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
laitassou committed Aug 24, 2020
1 parent 32fbbab commit ee0ba91
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
Binary file modified model_affine/affine/affine.onnx
Binary file not shown.
Binary file modified model_affine/affine/saved_model.pb
Binary file not shown.
Binary file modified model_affine/affine/variables/variables.data-00000-of-00001
Binary file not shown.
Binary file modified model_affine/affine/variables/variables.index
Binary file not shown.
6 changes: 3 additions & 3 deletions model_affine/model_affine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
y = np.array([-2,-5, -7, -12 ,-15, -5, -12,-10,-5],np.float32)


BATCH_SIZE = 4
num_epochs = 1000
BATCH_SIZE = 1
num_epochs = 200

dataset = tf.data.Dataset.from_tensor_slices(( x , y ))

Expand All @@ -29,7 +29,7 @@

model.compile(optimizer='sgd', loss='mse')

model.fit(dataset, epochs=num_epochs, steps_per_epoch=tf.data.experimental.cardinality(dataset).numpy() // BATCH_SIZE -1, verbose=0)
model.fit(dataset, epochs=num_epochs, steps_per_epoch=tf.data.experimental.cardinality(dataset).numpy() , batch_size = 1, verbose=0)

print(model.layers[0].get_weights())

Expand Down

0 comments on commit ee0ba91

Please sign in to comment.