Code Monkey home page Code Monkey logo

Comments (8)

jrieke avatar jrieke commented on August 29, 2024 2

Hey @SGevorg,

let's use the existing image classification w/ PyTorch template as an example here. As far as I can see, using Aim would just mean adding

aim.set_params({"lr": lr, "batch_size": batch_size, "num_epochs": num_epochs}, name="hparams")

around line 85 and adding

aim.track(metrics["loss"], name="loss", subset=name, epoch=epoch)
aim.track(metrics["accuracy"], name="accuracy", subset=name, epoch=epoch)

around line 220 (+ adding import and pip install of course).

Questions:

  • anything missing/wrong or anything else you'd like to have added?
  • is the preferred name for the hyperparmeters "hparams" or "params"? (you use both in the docs)
  • should the track method just use subset to differentiate between train/val/test or should the metrics also be named train_loss/val_loss/test_loss etc?

from traingenerator.

gorarakelyan avatar gorarakelyan commented on August 29, 2024 1

Hi @jrieke ,

I've added Aim to PyTorch image classification template and opened a PR. Can you have a look at it? Thanks a lot!

from traingenerator.

SGevorg avatar SGevorg commented on August 29, 2024

@jrieke thanks for the instructions.
Adding @gorarakelyan here too to help with the code.

re train/val/test they are provided as arguments to track - any additional argument converted into a context (key-value pairs). In this case you woul just call aim.track(metrics["loss"], name="loss", epoch=epoch, subset="train") and subsequent ones for test, val too.

from traingenerator.

gorarakelyan avatar gorarakelyan commented on August 29, 2024

Hi @jrieke ,

All correct, thanks for your effort!

  • I suggest using name hparams to be more specific
  • as @SGevorg mentioned, the phase should be passed as an argument to track function, which I see has been perfectly done here:
    aim.track(metrics["loss"], name="loss", -> subset=name <- , epoch=epoch)
  • nothing more to add as for now

Would be happy to help in case of more questions. Do you want me to open a PR?

This is an awesome project!

from traingenerator.

jrieke avatar jrieke commented on August 29, 2024

Hi @gorarakelyan,

yes, feel free to open a PR if you have time, otherwise, I'll do it later (not that much work anyway) and will send it to you for testing. Make sure to add Aim as an option in the sidebar here. You can also update the scikit-learn template if you like.

Best, Johannes

from traingenerator.

gorarakelyan avatar gorarakelyan commented on August 29, 2024

Great, thanks for the instructions, @jrieke. I will work on the PR and ping you once it is ready.

from traingenerator.

jrieke avatar jrieke commented on August 29, 2024

@gorarakelyan Sorry for the slight delay. I only changed 2 small things on your fork (hope that was OK; I added aim to the pip install line at the top of the generated code + moved the aim import a bit further down) and merged. It's now live on the website! 🥳

Thanks again for the contribution ❤️ Feel free to also add it to the scikit-learn template if you like.


Btw I noticed 2 minor issues with aim when running on my machine:

  1. This warning

    /Users/jrieke/opt/anaconda3/lib/python3.7/site-packages/aimrecords/artifact_storage/storage.py:3: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3,and in 3.9 it will stop working. 
    from collections import Iterator`
    
  2. When I delete the .aim folder before closing aim_session or finishing the script (which is what happens when I run pytest because I create a temporary dir for each test run, which gets deleted before the tests finish), I get this error:

    Something went wrong in _close. The process will continue to execute.
    _close: [Errno 2] No such file or directory: '/private/var/folders/1j/szl2n8g55053cfpnpdr_bpfc0000gn/T/tmp65jegpiw/.aim/default/8a8bbb00-5a00-11eb-8eac-8c8590b82ad8/objects/.aimrecords_storage/loss/current_bucket.bin'`
    

Nothing major but thought I'll mention it in case you want to look into it :)

from traingenerator.

gorarakelyan avatar gorarakelyan commented on August 29, 2024

Awesome! 🎉

Thanks a lot for the review and for reporting issues.

from traingenerator.

Related Issues (10)

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.