maxhodak / keras-molecules

Autoencoder network for learning a continuous representation of molecular structures.
MIT License
519 stars 146 forks source link

Top-level dir is not a module #40

Open dakoner opened 7 years ago

dakoner commented 7 years ago

I've been trying to package up keras-molecules as a module so I can run it on Google Cloud Machine Learning. Unfortunately, the top-level of keras-molecules (with train.py etc) isn't really module ready. The repo name has a "-" in it, and there's no top-level init.py.

maxhodak commented 7 years ago

What did you end up doing for this? Intuitively it doesn't feel like making the top level a module is the right thing to do but maybe having an invokable module in the molecules dir rather than having the logic in a top level script, so we could do python -m molecules.train and have a shell script or something in the top level as an alias that passes arguments through.

maxhodak commented 7 years ago

Can you point me to documentation for what Google Cloud Machine Learning expects?

dakoner commented 7 years ago

I just renamed the parent dir to keras_molecules, and added an init.py.

The way I usually like to structure this is:

toplevel/ toplevel/src/<all source code such as molecules/ goes here> toplevel/scripts/

and then no code goes in toplevel/, just README, LICENSE, setup.py.

On Tue, Nov 29, 2016 at 10:59 AM, Max Hodak notifications@github.com wrote:

What did you end up doing for this? Intuitively it doesn't feel like making the top level a module is the right thing to do but maybe having an invokable module in the molecules dir rather than having the logic in a top level script, so we could do python -m molecules.train and have a shell script or something in the top level as an alias that passes arguments through.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxhodak/keras-molecules/issues/40#issuecomment-263663988, or mute the thread https://github.com/notifications/unsubscribe-auth/AHtyQIdXymer-3F30EiqkEq0gF6IfirUks5rDHYDgaJpZM4K2724 .

dakoner commented 7 years ago

The docs for Cloud ML aren't great for custom jobs right now. Most of them are here: https://cloud.google.com/ml/docs/how-tos/preparing-models At the bottom it mentions setup.py.

I have a working example for Google Cloud Machine Learning. I could reformat it into a pull request if you want the recipe.

On Tue, Nov 29, 2016 at 10:59 AM, Max Hodak notifications@github.com wrote:

Can you point me to documentation for what Google Cloud Machine Learning expects?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxhodak/keras-molecules/issues/40#issuecomment-263664060, or mute the thread https://github.com/notifications/unsubscribe-auth/AHtyQOJrY-ZNIMipnvNl7KFUfkx4GQhiks5rDHYkgaJpZM4K2724 .