Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 450 Bytes

sl-nn.md

File metadata and controls

16 lines (11 loc) · 450 Bytes

Single layer neural network

dataset = windowed_dataset(x_train, window_size, batch_size, shuffle_buffer_size)
print(dataset)
l0 = tf.keras.layers.Dense(1, input_shape=[window_size])
model = tf.keras.models.Sequential([l0])


model.compile(loss="mse", optimizer=tf.keras.optimizers.SGD(lr=1e-6, momentum=0.9))
model.fit(dataset,epochs=100,verbose=0)

print("Layer weights {}".format(l0.get_weights()))