machine learning - Keras model.fit() - which training algorithm is used? -
using keras on top of theano create mlp train , use predict time series. independently of structure , depth of network cannot figure out (keras documentation, stackoverflow, searching net...) training algorithm (backpropagation,...) keras' model.fit()
function using.
within theano (used without keras before) define way parameters adjusted myself with
self.train_step = theano.function(inputs=[u_in, t_in, lrate], outputs=[cost, y], on_unused_input='warn', updates=[(p, p - lrate * g) p, g in zip(self.parameters, self.gradients)], allow_input_downcast=true)
not finding information causes fear missing essential , may totally stupid question.
can me out here? lot in advance.
look @ example here:
... model = sequential() model.add(conv2d(32, kernel_size=(3, 3), activation='relu', input_shape=input_shape)) model.add(conv2d(64, (3, 3), activation='relu')) model.add(maxpooling2d(pool_size=(2, 2))) model.add(dropout(0.25)) model.add(flatten()) model.add(dense(128, activation='relu')) model.add(dropout(0.5)) model.add(dense(num_classes, activation='softmax')) model.compile(loss=keras.losses.categorical_crossentropy, optimizer=keras.optimizers.adadelta(), metrics=['accuracy']) model.fit(x_train, y_train, batch_size=batch_size, epochs=epochs, verbose=1, validation_data=(x_test, y_test)) score = model.evaluate(x_test, y_test, verbose=0) ...
model.fit not use algorithm predict outcome, rather uses model describe. optimiser algorithm specified in model.compile
e.g.
model.compile(loss=keras.losses.categorical_crossentropy, optimizer=**keras.optimizers.adadelta()**, metrics=['accuracy'])
you can find out more available optimisers here : https://keras.io/optimizers/
wiki
Comments
Post a Comment