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

Keras API #1

Open
minimaxir opened this issue Oct 30, 2018 · 16 comments
Open

Keras API #1

minimaxir opened this issue Oct 30, 2018 · 16 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@minimaxir
Copy link

As mentioned in discussion on Hacker News, native support for Keras's APIs (including layer support) would make implementation of adanet a lot easier for Keras-based projects (either via tf.keras or external keras).

@cweill cweill added the enhancement New feature or request label Oct 30, 2018
@cweill
Copy link
Contributor

cweill commented Oct 30, 2018

@minimaxir Thank you for filing this feature request. We'll take a look.

@bhack
Copy link

bhack commented Oct 30, 2018

/cc @jhfjhfj1

@svjack
Copy link

svjack commented Nov 29, 2018

Without Keras support of project, it may have some trouble to visualize AdaNet produced construction,
like use graphviz in plot_model
Are there some replacement to implement this function ?

@cweill
Copy link
Contributor

cweill commented Nov 29, 2018

@svjack: You can visualize the learned architecture in TensorBoard by looking at the Graph tab.

@svjack
Copy link

svjack commented Nov 29, 2018

@cweill I suggest, Can create a chapter to tell about the algorithm procedure among different iteration (with namespace control) with the help of tensorboard to visualize in the document you will release.

@shsshs
Copy link

shsshs commented Jan 18, 2019

Any news on this?

@cweill
Copy link
Contributor

cweill commented Jan 19, 2019

We're working on a new Keras API for AdaNet, but don't have a timeline on it yet. Keep an eye out for related commits over the next few months.

@cweill cweill pinned this issue Apr 8, 2019
@cweill cweill changed the title Keras Model API support for adanet Keras Model API support Apr 8, 2019
@cweill cweill added the help wanted Extra attention is needed label Apr 8, 2019
@cweill
Copy link
Contributor

cweill commented Apr 8, 2019

The timeline will look roughly like so (subject to change):

  1. Support tf.keras.Layers in subnetworks.
  2. Support tf.keras.Sequential and Keras functional API models in adanet.AutoEnsembleEstimator.
  3. Implement adanet.keras.Model and adanet.keras.AutoEnsemble APIs to be Keras end-to-end.

Please reach out here or PM me if you are interested in testing out our new Keras support as we add it.

@cweill cweill self-assigned this Apr 8, 2019
@cweill cweill mentioned this issue May 3, 2019
7 tasks
@JaeDukSeo
Copy link

this is amazing!

@cweill
Copy link
Contributor

cweill commented Jun 19, 2019

We are going for an API that is both familiar, but also flexible enough to define an search space of keras models. Here's an idea of the kind of API we are going for:

submodel1 = Sequential()
submodel1.add(Dense(8, input_dim=4, activation='relu'))
submodel1.add(Dense(3, activation='softmax'))
submodel1.compile(loss='categorical_crossentropy', optimizer='adam')

submodel2 = Sequential()
submodel2.add(Dense(16, input_dim=4, activation='relu'))
submodel2.add(Dense(3, activation='softmax'))
submodel2.compile(loss='categorical_crossentropy', optimizer='adam')

model = adanet.keras.AutoEnsemble(
    ensembler=adanet.ensemble.UniformAverage(),
    ensemble_strategy=adanet.ensemble.AllStrategy(),
    candidate_pool={
        "Model1": submodel1,
        "Model2": submodel2,
    })
model.compile(loss='categorical_crossentropy', optimizer='adam')
model.fit(x=..., y=..., steps=100)

Feedback is welcome!

cweill pushed a commit that referenced this issue Jun 24, 2019
…_runner | Closes PR #115.

Copybara import of the project:

  - 0df5fc6 Changed the protobuf version to 3.6.1 to accomodate lates... by chandramouli <[email protected]>
  - 64985e0 Merge branch 'master' into master by Charles Weill <[email protected]>
  - 3d8cd3a Merge pull request #1 from tensorflow/master by chandramoulirajagopalan <[email protected]>
  - b21ed49 Added tf.distribute.MirroredStrategy() test to estimator_... by chandramouli <[email protected]>
  - 7116db2 Using MultiWorkerMirroredStrategy instead of MirroredStra... by chandramouli <[email protected]>
  - b0c21af Using MultiWorkerMirroredStrategy instead of MirroredStra... by chandramouli <[email protected]>
  - 62b3050 Merge branch 'master' into master by chandramoulirajagopalan <[email protected]>
  - 8185883 Merge 62b3050 into cfb35... by chandramoulirajagopalan <[email protected]>

PiperOrigin-RevId: 254859026
@atinsood
Copy link

@cweill this looks great but is this already close to an alpha/beta(or merged into some branch already) where if I want to try this out I can go ahead and try it out, or you guys still working through this. any rough notebook with a broad idea of steps would be great.

  • thanks

@cweill
Copy link
Contributor

cweill commented Jun 27, 2019

@atinsood: We don't currently have anything you can try out, since we're still coming up with a reasonable design. But keep an eye out, we'll be pushing some experimental code soon to an adanet.keras subpackage soon.

@JaeDukSeo
Copy link

I would love to use it when it comes out

@cweill cweill mentioned this issue Sep 18, 2019
5 tasks
@cweill cweill assigned cweill and unassigned cweill Sep 18, 2019
@cweill cweill changed the title Keras Model API support Keras API Sep 18, 2019
cweill pushed a commit that referenced this issue Sep 19, 2019
…#1 #121

In estimator_distributed_test_runner.py.

PiperOrigin-RevId: 270085601
cweill pushed a commit that referenced this issue Oct 2, 2019
PiperOrigin-RevId: 272420256
cweill pushed a commit that referenced this issue Oct 17, 2019
This API is under development which means it is experimental and subject to change.

PiperOrigin-RevId: 275288072
cweill pushed a commit that referenced this issue Oct 17, 2019
This API is under development which means it is experimental and subject to change.

PiperOrigin-RevId: 275293435
cweill pushed a commit that referenced this issue Oct 21, 2019
cweill pushed a commit that referenced this issue Oct 28, 2019
PiperOrigin-RevId: 276528107
cweill pushed a commit that referenced this issue Oct 28, 2019
PiperOrigin-RevId: 276556571
cweill pushed a commit that referenced this issue Oct 28, 2019
cweill pushed a commit that referenced this issue Nov 6, 2019
Create a private `_KerasHead` object to provide necessary values to create a `tf.estimator.EstimatorSpec` within AdaNet without the need of a `tf.estimator.Head`.

PiperOrigin-RevId: 278870525
cweill pushed a commit that referenced this issue Nov 20, 2019


To construct a `tf.train.Checkpoint`, the user needs to pass all created variables that they wish to save and restore.

This will give us more flexibility down the line for extracting subnetworks from the AdaNet model, and support Keras Models.

Additionally, disable support for the BoostedTreesEstimator since it has untrackable variables which conflict with `tf.train.Checkpoint`.

PiperOrigin-RevId: 281404924
@shendiaomo
Copy link

When would this Keras API have a final distribution? I think it's vital for the widespread application of AdaNet.

@cweill
Copy link
Contributor

cweill commented Dec 3, 2019

@shendiaomo: This is still a work in progress, but we are actively pursuing this direction. It's all very experimental at the moment, since we would like it to fit in well with the rest of the Keras and TF 2.0 ecosystem, meaning good integration with other systems like keras-tuner.

We're working on an experimental AdaNet model search API. You can have a peek under adanet/experimental. We will be demoing this Tuesday Morning at the Google Booth at NeurIPS.

cweill pushed a commit that referenced this issue Jan 14, 2020
PiperOrigin-RevId: 288714068
cweill pushed a commit that referenced this issue Jan 14, 2020
PiperOrigin-RevId: 289083381
cweill pushed a commit that referenced this issue Jan 27, 2020
PiperOrigin-RevId: 289909363
cweill pushed a commit that referenced this issue Jan 27, 2020
cweill pushed a commit that referenced this issue Jan 27, 2020
Additionally, add a seed argument to RandomKStrategy ensemble strategy.

PiperOrigin-RevId: 290273070
cweill pushed a commit that referenced this issue Jan 27, 2020
PiperOrigin-RevId: 290337022
@cweill
Copy link
Contributor

cweill commented Jan 31, 2020

@minimaxir, @shendiaomo: adanet.experimental.ModelSearch (a.k.a. adanet.ModelFlow) is @csvillalta's API for AutoML using Keras and TF 2. Please take a look at in under adanet/experimental, and let us know what you think.

Be sure to try out the ModelFlow demo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

9 participants