Skip to content

Commit

Permalink
Add documentation for save and load functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Apr 26, 2015
1 parent 05e86ae commit 69b69e4
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions docs/sources/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Linear stack of layers.
model = keras.models.Sequential()
```
- __Methods__:
- __add(layer)__: Add a layer to the model.
- __compile(optimizer, loss, class_mode="categorical")__:
- __add__(layer): Add a layer to the model.
- __compile__(optimizer, loss, class_mode="categorical"):
- __Arguments__:
- __optimizer__: str (name of optimizer) or optimizer object. See [optimizers](optimizers.md).
- __loss__: str (name of objective function) or objective function. See [objectives](objectives.md).
- __class_mode__: one of "categorical", "binary". This is only used for computing classification accuracy or using the predict_classes method.
- __fit(X, y, batch_size=128, nb_epoch=100, verbose=1, validation_split=0., validation_data=None, shuffle=True, show_accuracy=False)__: Train a model for a fixed number of epochs.
- __fit__(X, y, batch_size=128, nb_epoch=100, verbose=1, validation_split=0., validation_data=None, shuffle=True, show_accuracy=False): Train a model for a fixed number of epochs.
- __Arguments__:
- __X__: data.
- __y__: labels.
Expand All @@ -23,15 +23,16 @@ model = keras.models.Sequential()
- __validation_data__: tuple (X, y) to be used as held-out validation data. Will override validation_split.
- __shuffle__: boolean. Whether to shuffle the samples at each epoch.
- __show_accuracy__: boolean. Whether to display class accuracy in the logs to stdout at each epoch.
- __evaluate(X, y, batch_size=128, show_accuracy=False, verbose=1)__: Show performance of the model over some validation data.
- __evaluate__(X, y, batch_size=128, show_accuracy=False, verbose=1): Show performance of the model over some validation data.
- __Arguments__: Same meaning as fit method above. verbose is used as a binary flag (progress bar or nothing).
- __predict_proba(X, batch_size=128, verbose=1)__: Return an array of predictions for some test data.
- __predict_proba__(X, batch_size=128, verbose=1): Return an array of predictions for some test data.
- __Arguments__: Same meaning as fit method above.
- __predict_classes(X, batch_size=128, verbose=1)__: Return an array of class predictions for some test data.
- __predict_classes__(X, batch_size=128, verbose=1): Return an array of class predictions for some test data.
- __Arguments__: Same meaning as fit method above. verbose is used as a binary flag (progress bar or nothing).
- __train__(X, y, accuracy=False)__: Single gradient update on one batch. if accuracy==False, return tuple (loss_on_batch, accuracy_on_batch). Else, return loss_on_batch.
- __test__(X, y, accuracy=False)__: Single performance evaluation on one batch. if accuracy==False, return tuple (loss_on_batch, accuracy_on_batch). Else, return loss_on_batch.

- __train__(X, y, accuracy=False): Single gradient update on one batch. if accuracy==False, return tuple (loss_on_batch, accuracy_on_batch). Else, return loss_on_batch.
- __test__(X, y, accuracy=False): Single performance evaluation on one batch. if accuracy==False, return tuple (loss_on_batch, accuracy_on_batch). Else, return loss_on_batch.
- __save_weights__(fname): Store the weights of all layers to a HDF5 file.
- __load_weights__(fname): Sets the weights of a model, based to weights stored by __save__weights__. You can only __load__weights__ on a savefile from a model with an identical architecture. __save__weights__ can be called either before or after the __compile__ step.

__Examples__:

Expand Down

0 comments on commit 69b69e4

Please sign in to comment.