Giter Site home page Giter Site logo

mrae's Introduction

mrae.py

Michael Nolan

Multiblock Recurrent Autoencoder implementation in Pytorch

mrae's People

Contributors

m-nolan avatar

Watchers

 avatar

Forkers

mnipshagen

mrae's Issues

`mrae.fit()` training loop needs early stopping mechanism

for epoch_idx in tqdm(range(max_epochs)):

The current training loop runs and optimizes the model to minimize training loss. This has no stop point beyond the max iterations argument.

This needs an early stopping mechanism, either a moving average of the loss delta, some train/valid loss crossover, etc.

Test with the sample dataset.
Add a test with random data (?) to show that it works to stop training if it isn't learning anything.

Refactor `run_example.py`

current_dir = os.path.dirname(__file__)

The directory management and hparam.yaml file management should be refactored to utils.py.

The rest of the script should be refactored into a def main() method that's called from the if __name__ == "__main__": ... block at the end of the file. Maybe the "create_mrae_from_hyperparams()" method, etc, could be moved to utils.py as well.

Save current code version to run directory

def _initialize_opt(self,save_dir,overwrite):

I don't plan to change the model architecture at this point, other than perhaps to move the training loop out of the MRAE model and into a separate training run manager class. Regardless, having the current code state (i.e. git commit hash, etc) saved into the run directory along with the model checkpoints is a good idea. Either adding this at the run initialization or at the beginning of the training script would work, I think.

Save train/valid loss values

epoch_valid_loss = self.compute_epoch_loss(

The train/valid objective and loss outputs should be saved for each epoch. Maybe some stats over the batch as well?

You would want to be able to write to this again after resuming a previous run, so something simple like a .csv file would work fine.

ex:
epoch_idx,train_total_loss,train_output_loss,train_block_loss_0,train_block_loss_1,...,valid_total_loss,valid_output_loss,...

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.