You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the Quick Start page and the Readme only cover the installation of propulate. For a proper quick start, it would be nice to have a short summary of how to use propulate (i.e., less detailed than the step-by-step Tutorials).
Something like a minimum working example of commands I can just copy and paste to get propulate running in my code and tweak it from there using the more detailed docs. Most of it could probably be taken from tutorials/propulator_example.py, but removing all non-essential code like the argparsing and using default parameters where possible.
Sort of like this:
importpropulatefrommpi4pyimportMPIimportrandom# Set the communicator and the optimization parameters comm=MPI.COMM_WORLDrng=random.Random(MPI.COMM_WORLD.rank)
population_size=comm.size*2generations=100crossover_probability=0.7mutation_probability=0.4random_init_probability=0.1checkpoint='propulate_checkpoints'propulate.utils.set_logger_config()
# Define the function to minimize and the search space, e.g. a 2D sphere function on (-5.12, 5.12)^2 defloss_fn(params):
returnparams['x'] **2+params['y'] **2limits= {"x": (-5.12, 5.12), "y": (-5.12, 5.12)}
# Initialize the propagator and propulator propagator=propulate.utils.get_default_propagator(pop_size=population_size, limits=limits,
mate_prob=crossover_probability, mut_prob=mutation_probability,
random_prob=random_init_probability, rng=rng)
propulator=propulate.Propulator(loss_fn=loss_fn, propagator=propagator, comm=comm, generations=generations,
checkpoint_path=checkpoint, rng=rng)
# Run optimization and get summary of results. propulator.propulate()
propulator.summarize()
Ideally, you could make this even shorter by setting more default values, e.g., for the probabilities (if feasible).
Also, the link to the scripts subfolder in Quick Start seems to be outdated and should probably point to the tutorials.
The text was updated successfully, but these errors were encountered:
Thanks for your comment! I assigned myself to this issue and will include your suggestions. I also decided to add a more elaborate quickstart section in the README which will be merged into the master branch soon.
Currently, the Quick Start page and the Readme only cover the installation of propulate. For a proper quick start, it would be nice to have a short summary of how to use propulate (i.e., less detailed than the step-by-step Tutorials).
Something like a minimum working example of commands I can just copy and paste to get propulate running in my code and tweak it from there using the more detailed docs. Most of it could probably be taken from tutorials/propulator_example.py, but removing all non-essential code like the argparsing and using default parameters where possible.
Sort of like this:
Ideally, you could make this even shorter by setting more default values, e.g., for the probabilities (if feasible).
Also, the link to the scripts subfolder in Quick Start seems to be outdated and should probably point to the tutorials.
The text was updated successfully, but these errors were encountered: