Giter Club home page Giter Club logo

Comments (2)

Hongyu-yu avatar Hongyu-yu commented on June 14, 2024 1

Hi @rschireman,
Sure, with some small modification below on the source code, you can sweep hyperparameters.
In nequip/scripts/train.py line 25, change the default run_name="NequIP", into run_name="rand_"+str(uuid.uuid4()), and insert import uuid in the first line so that the sweep will generate random run_name for the calculations.
You can either change the code in your environment directly or on the source code with pip install ..

Then you can create two config file, one for the sweep hyperparameter and one for the basic config file.

For sweep_config.yaml, here is an example:

project: {your project name}
program: nequip-train
method: random
name: sweep_1
description: sweep over loss coefficients and batch size

# metric:
#   goal: minimize
#   name: validation_f_rmse

command:
  - ${env}
  - ${program}
  - ".../base.yaml" # Absolute path of your basic config yaml file
 
parameters:
  batch_size:
    distribution: int_uniform
    min: 1
    max: 5
  loss_coeffs:
      parameters:
          stress:
              distribution: uniform
              min: 1.0
              max: 10.0
          total_energy:
              value: 
              - 1.
              - PerAtomMSELoss
          forces:
              distribution: uniform
              min: 1
              max: 10

Hope it helps!

from nequip.

Linux-cpp-lisp avatar Linux-cpp-lisp commented on June 14, 2024

Thanks very much for posting this info @Hongyu-yu !

An alternative, without modifying the source, would then also be to make your program in for wandb a simple python script that gets the JSON config of the sweep hyperparams, reads the base config, and writes a new YAML file of the merge for the specific run. This script could be re-used for all sweeps.

If that is the only modification needed to make it work, alternatively, we could add a --uuid-run-name flag to nequip-train so this works out of the box. The only unpleasant thing about that is that restarting/finding training runs becomes a pain, since you have to go through each uuid named dir looking for the right values in config.yaml.

from nequip.

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.