Giter Site home page Giter Site logo

Using LSTM with AdaNet about adanet HOT 4 OPEN

tensorflow avatar tensorflow commented on July 17, 2024 2
Using LSTM with AdaNet

from adanet.

Comments (4)

dataforcast avatar dataforcast commented on July 17, 2024

Hello mmuratarat,
Hi,

I've worked on Adanet framework upon RNN type network (Simple RNN, LSTM and GRU).

In order to train mixture weights, Adanet may use logits or last layer from subnetwork candidates.
Then I force Adanet to use logits rather then last layer in creating Adanet Estimator with instructions :

from adanet.ensemble import MixtureWeightType
from adanet.ensemble.weighted import ComplexityRegularizedEnsembler

ensembler = ComplexityRegularizedEnsembler(mixture_weight_type=mixture_weight_type, adanet_lambda=1.e-3)
list_ensembler = [ensembler]

adanet_estimator = adanet.Estimator(
    ensemblers   = [ensembler],    
    max_iteration_steps=500,
    subnetwork_generator = ...,
    head = ...,
    config= ...,    
    evaluator=adanet.Evaluator(
        input_fn=...,
        steps=None))
....
results, _ = tf.estimator.train_and_evaluate(adanet_estimator, train_spec, eval_spec)

Hope this will help

from adanet.

cweill avatar cweill commented on July 17, 2024

@mmuratarat: We've successfully train all kinds of RNNs with different cells like lstm, cudnn_lstm, and gru. Like @dataforcast mentions, you will need to create a custom adanet.subnetwork.Generator and adanet.subnetwork.Builder subclasses that use tf.nn.dynamic_rnn(). You can look at SimpleDNN for inspiration.

from adanet.

tx2010011751 avatar tx2010011751 commented on July 17, 2024

Hello! I'm a green hand in adanet. Would you please tell me if I have to build the LSTM model myself rather than using the LSTM API provided in kereas or tensorflow when using adanet? If so, would you please give an example about using LSTM with adanet(the sample you use for test RNN). Thank you very much.

from adanet.

cweill avatar cweill commented on July 17, 2024

@tx2010011751 You should be able to use the tf.contrib.estimator.RNNEstimator with adanet.AutoEnsembleEstimator if you want to try ensembling RNN models.

As a first step, try getting tf.contrib.estimator.RNNEstimator to train on its own, and next try it in adanet.

from adanet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.