Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Sequential.fit() with Model.fit() #8192

Merged
merged 5 commits into from
Nov 10, 2017
Merged

Conversation

ozabluda
Copy link
Contributor

... and improve docstrings.

A couple of API changes, all backward compatible (additions and more permissive), except that now Model.fit(epoch=1) is the default (matching Sequential.fit(). I didn't find any example/*.py affected by this.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe not all proposed docstring edits are warranted. Please put them in a different PR, to make it easier to review and merge.

Ok for the API sync.

@@ -247,12 +247,12 @@ def test_EarlyStopping_reuse():
stopper = callbacks.EarlyStopping(monitor='acc', patience=patience)
weights = model.get_weights()

hist = model.fit(data, labels, callbacks=[stopper])
hist = model.fit(data, labels, callbacks=[stopper], epochs=20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would slow down the tests and should be set to a lower value (e.g. 10). Is this change related to the rest of the PR? Doesn't look like it is...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this change (introduced in the second commit) tests fail (see first commit). Maybe this change is just papering over a real bug?

I chose epochs=20, because earlier in the same function epochs=20 is used. In the whole file, epochs=20 is used 8 times, and epochs=10 is used 0 times.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok then.

@ozabluda
Copy link
Contributor Author

Put docstrings into a different PR #8233

@ozabluda
Copy link
Contributor Author

ozabluda commented Nov 5, 2017

@fchollet, maybe this PR and #8233 are good candidates for the upcoming Keras 2.1.0, since they are supposedly API and docs improvements.

@fchollet
Copy link
Member

@ozabluda I will take a look, thanks.

Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@fchollet fchollet merged commit d1ee945 into keras-team:master Nov 10, 2017
nbam pushed a commit to nbam/keras that referenced this pull request Nov 22, 2017
* Sync Sequential.fit() with Model.fit()

* Specify explicit epochs=20

...instead of relying on implicit default value.

* Revert docstring changes

* pep8

* pep8
@ozabluda ozabluda deleted the patch-10 branch November 26, 2017 00:46
nbam pushed a commit to nbam/keras that referenced this pull request Nov 30, 2017
* Sync Sequential.fit() with Model.fit()

* Specify explicit epochs=20

...instead of relying on implicit default value.

* Revert docstring changes

* pep8

* pep8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants