Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Now able to use and create custom tensorflow heads, embedders, and middleware. #135

Merged
merged 5 commits into from Dec 5, 2018

Conversation

ryanpeach
Copy link
Contributor

@ryanpeach ryanpeach commented Nov 30, 2018

Ref #134

I modified the following classes:

  • HeadParameters
  • MiddlewareParameters
  • InputEmbedderParameters

Adding a path property (or function as I mention in challenges).

Then I modified:

  • GeneralTensorFlowNetwork.get_input_embedder
  • GeneralTensorFlowNetwork.get_middleware
  • GeneralTensorFlowNetwork.get_output_head

To use these paths instead of their own local's.

I moved a local dictionary inside GeneralTensorFlowNetwork.get_input_embedder called mod_names to embedder_parameters.MOD_NAMES so that it's more accessible.

Challenges

  • InputEmbedderParameters.path can not be a property like the rest. You can call it with emb_type and the path will be created. But that's different than how most path's are made.

Pytest

I ran pytest locally and do not see any dramatic changes in the number of passing tests.

…ddleware within your own packages, by allowing Parameters to have a path property.
@aipg-hub
Copy link
Collaborator

Can one of the admins verify this patch?

@gal-leibovich
Copy link
Contributor

LGTM.
Currently the golden tests are not running with the CI. Could you please run tests/test_golden.py locally to make sure that golden tests are passing?

@scttl CI is failing with Unable to locate credentials. You can configure credentials by running "aws configure". Exited with code 255. Could you please take a look?

@safrooze Please take a look. Note that setting a user defined Embedder/MW/Head is currently not supported with mxnet (and this PR will not fix that).

Copy link
Contributor

@gal-leibovich gal-leibovich left a comment

Choose a reason for hiding this comment

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

LGTM. Need to have tests passing, and rebase.

@ryanpeach
Copy link
Contributor Author

ryanpeach commented Dec 3, 2018 via email

@scttl
Copy link
Contributor

scttl commented Dec 3, 2018

Yep the CI wasn't initially set to run on forked builds (just changed and kicked off a build for this and other open PRs).

@ryanpeach
Copy link
Contributor Author

I could also run via the Amazon released docker container if that has all the dependencies. I heard about this project and am using it via the new Sagemaker RL.

@ryanpeach
Copy link
Contributor Author

Thanks for fixing the CI much appreciated.

@ryanpeach
Copy link
Contributor Author

What is your opinion on InputEmbedderParameters.path?

@gal-leibovich
Copy link
Contributor

Although it differs from the solution used on other modules, I think that having it as method makes sense in this InputEmbedder case.

If you could rebase your branch, we can merge it to master.

@gal-leibovich gal-leibovich merged commit 9e66bb6 into IntelLabs:master Dec 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants