Code Monkey home page Code Monkey logo

Comments (5)

shendiaomo avatar shendiaomo commented on June 13, 2024

There seem to be two negative effects of this:

  1. A repeated Dataset (dataset.repeat(10) for example) cannot stop training via OutOfRangeError or StopIteration, we have to set steps or max_steps, which is inconsistent with canned Estimators.
  2. If a user doesn't shuffle the dataset, AdaNet may repeatedly use the first max_iteration_steps * batch_size samples each time, thus fitting to a subset of the training data.

Am I right? @cweill

from adanet.

cweill avatar cweill commented on June 13, 2024

@shendiaomo: You are correct on both counts. For this reason, we request that the user configures the max_iteration_steps to be the number of repetitions desired, which unfortunately requires the user to do some extra math (max_iteration_steps = num_examples / batch_size * num_epochs_per_iteration).

Assuming each adanet iteration trains over several epochs, 2. should be less of an issue in practice if your base learners are randomly initialized. They will tend to learn different biases, and form a strong ensemble regardless.

from adanet.

shendiaomo avatar shendiaomo commented on June 13, 2024

@shendiaomo: You are correct on both counts. For this reason, we request that the user configures the max_iteration_steps to be the number of repetitions desired, which unfortunately requires the user to do some extra math (max_iteration_steps = num_examples / batch_size * num_epochs_per_iteration).

Assuming each adanet iteration trains over several epochs, 2. should be less of an issue in practice if your base learners are randomly initialized. They will tend to learn different biases, and form a strong ensemble regardless.

Great! Thanks for the explanation. However, that's sort of not handy to do the math, imagine someone wants to replace the DNNClassifier in her application into adanet.Estimator, there may be lots of work. Will you have a plan to improve this? Or will the Keras version avoid the same situation?

from adanet.

le-dawg avatar le-dawg commented on June 13, 2024

@cweill

@shendiaomo: You are correct on both counts. For this reason, we request that the user configures the max_iteration_steps to be the number of repetitions desired, which unfortunately requires the user to do some extra math (max_iteration_steps = num_examples / batch_size * num_epochs_per_iteration).

Assuming each adanet iteration trains over several epochs, 2. should be less of an issue in practice if your base learners are randomly initialized. They will tend to learn different biases, and form a strong ensemble regardless.

From the tutorials:

max_iteration_steps=TRAIN_STEPS // ADANET_ITERATIONS,

If I want to train with 100 epochs over one Adanet iteration, meaning num_examples/batch_size steps per epoch, should I set max_iteration_steps to that value?

I have a sample size of 5265 and batch sizes of 50, so I have about 105 update steps per epoch. Should my max_iteration_steps be 10500?

from adanet.

le-dawg avatar le-dawg commented on June 13, 2024

Pinging

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.