Skip to content

Commit

Permalink
[keras/models/cloning.py,keras/models/sharpness_aware_minimization.py…
Browse files Browse the repository at this point in the history
…] Standardise docstring usage of "Default to"
  • Loading branch information
SamuelMarks committed Apr 13, 2023
1 parent 0f8e81f commit b96f2bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion keras/models/cloning.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,12 +474,13 @@ def clone_model(model, input_tensors=None, clone_function=None):
model (except `InputLayer` instances). It takes as argument the
layer instance to be cloned, and returns the corresponding layer
instance to be used in the model copy. If unspecified, this callable
defaults to the following serialization/deserialization function:
becomes the following serialization/deserialization function:
`lambda layer: layer.__class__.from_config(layer.get_config())`.
By passing a custom callable, you can customize your copy of the
model, e.g. by wrapping certain layers of interest (you might want
to replace all `LSTM` instances with equivalent
`Bidirectional(LSTM(...))` instances, for example).
Defaults to `None`.
Returns:
An instance of `Model` reproducing the behavior
Expand Down
8 changes: 4 additions & 4 deletions keras/models/sharpness_aware_minimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class SharpnessAwareMinimization(Model):
Args:
model: `tf.keras.Model` instance. The inner model that does the
forward-backward pass.
rho: float, defaults to 0.05. The gradients scaling factor.
num_batch_splits: int, defaults to None. The number of mini batches to
rho: float. The gradients scaling factor. Defaults to `0.05`.
num_batch_splits: int. The number of mini batches to
split into from each data batch. If None, batches are not split into
sub-batches.
name: string, defaults to None. The name of the SAM model.
sub-batches. Defaults to None.
name: string. The name of the SAM model. Defaults to None.
Reference:
[Pierre Foret et al., 2020](https://arxiv.org/abs/2010.01412)
Expand Down

0 comments on commit b96f2bc

Please sign in to comment.