broadinstitute / AutoTrain

Using RL to solve overfitting in neural networks
0 stars 0 forks source link

Create autotrain package #5

Open jccaicedo opened 3 years ago

jccaicedo commented 3 years ago

It would be nice to have a package with code that we can reuse using import statements. For this, we need to create a autotrain directory and move the modules that we believe can be reused. For this, we need to configure a setup.py file with the description and dependencies, so we can install our package using pip install -e .

The notebooks and other non-reusable code can be move to a parallel directory that we can name experiments.

ctrlnomad commented 3 years ago

That's a good point.

Following this guide on How To Structure Your Package. I came to the following conclusion: this repository will have all the research materials & notebooks for AutoTrain and in the early stages (now) will also contain the autotrain library itself. If we want to make this a proper package in the future we will have to decouple the research from the library but that shouldn't be too hard.

To get the newest version of the library you will have to run pip install -e <repo_root>/autotrain at the top of the notebook. The setup file is located under this path<repo_root>/autotrain/setup.py.

In the python files/notebooks, the import structure will be important and can go something like this:

import gym
import autotrain

import autotrain.agent as agent_factory
import autotrain.utils as utils

if __name__ == "__main__":
    env = gym.make('AutoTrain-v0')
    agent = agent_factory.make(... params)

   ...

I also like the idea of having a separate folder for experiments. The commit has the following hash: [min_work_proto 39378b1]

jccaicedo commented 3 years ago

Sounds good. This is a low priority issue, which means we can change the project little by little to get there. I think you make a good point about open science experiments and a package, and I also agree that we can eventually separate them in different repos. I think just as a first step, putting them in a separate folder is good enough.

On Thu, Jul 23, 2020, 15:31 Sultan K notifications@github.com wrote:

That's a good point.

Following this guide on How To Structure Your Package https://docs.python-guide.org/writing/structure/. I came to the following conclusion: this repository will have all the research materials & notebooks for AutoTrain and in the early stages (now) will also contain the autotrain library itself. If we want to make this a proper package in the future we will have to decouple the research from the library but that shouldn't be too hard.

To get the newest version of the library you will have to run pip install -e autotrain at the top of the notebook. The setup file is located under this path/autotrain/setup.py.

In the python files/notebooks, the import structure will be important and can go something like this:

import gym import autotrain

import autotrain.agent as agent_factory import autotrain.utils as utils

if name == "main": env = gym.make('AutoTrain-v0') agent = agent_factory.make(... params)

...

I also like the idea of having a separate folder for experiments. The commit has the following hash: [min_work_proto 39378b1]

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/broadinstitute/AutoTrain/issues/5#issuecomment-663191740, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZNVX4VF23SCMD23UYGDKLR5CFYDANCNFSM4PF4CC7Q .