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

Typing the lamb optimizer. #931

Merged
merged 8 commits into from
Jan 28, 2020
Merged

Typing the lamb optimizer. #931

merged 8 commits into from
Jan 28, 2020

Conversation

gabrieldemarmiesse
Copy link
Member

Linked to #894

Copy link
Member

@seanpmorgan seanpmorgan left a comment

Choose a reason for hiding this comment

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

Failing on linux tests for:
TypeError: type of argument "learning_rate" must be one of (Tensor, float, float16, float32); got tensorflow.python.keras.optimizer_v2.learning_rate_schedule.InverseTimeDecay instead

Seems like this can be handled by modifying the types that are accepted... but I'm more confused as to why this fails only for linux builds. typeguard is an OS agnostic python library.

@gabrieldemarmiesse
Copy link
Member Author

That's definitly strange.

I read the docs a second time, and it says:

The decorator also respects the optimized mode setting so it does nothing when the interpreter is running in optimized mode.

Do you think it's related?

exclude_from_weight_decay=None,
exclude_from_layer_adaptation=None,
name='LAMB',
learning_rate: Union[FloatTensorLike, Callable] = 0.001,
Copy link
Member

Choose a reason for hiding this comment

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

Looks good. Did we ever figure out why this was only failing for linux?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope haha, my overall position on this is that we're very early in the history of tooling atound typing. We can try typeguard now, but if we see that it doesn't work well, we can drop it until the field is more mature.

Copy link
Member

@seanpmorgan seanpmorgan 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!

@seanpmorgan seanpmorgan merged commit 062e313 into tensorflow:master Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants