Please enable JavaScript.
Coggle requires JavaScript to display documents.
KERAS 102- SEQUENTIAL MODEL (Steps (Input (via tuple-type "input…
KERAS 102- SEQUENTIAL MODEL
Gen info
can initialize by listing a list of layers such as Dense(...), Activation("relu"), Dense(...), Activation("softmax"), ...
also can flexibly add layers such as model.add(Activation("softmax")), model.add(Dense(...)), etc.
from Keras.model import Sequential
Steps
Compile
REQUIRED steps to configure a model
3 parameters
loss
can be user-defined
metrics
could be user-defined
optimizer
Training
fit(self, x=None, y=None, batch_size=None, epochs=1, verbose=1, callbacks=None, validation_split=0.0, validation_data=None, shuffle=True, class_weight=None, sample_weight=None, initial_epoch=0, steps_per_epoch=None, validation_steps=None)
Input
via tuple-type "input_shape"
this parameters could accept integers, None (indicate any positive integers are accepted)
Need to specify
e.g, Dense(32, input_shape=(28,28))
can specify "batch_size" in the first layer
Evaluate
model.evaluate(x,y,batch_size,sample_weight)
Return value of loss and metrics