Coder Social home page Coder Social logo

Comments (7)

justindujardin avatar justindujardin commented on July 1, 2024

Thanks for the gist example! Based on it I was able to get the new style code working without a plangym dependency! πŸ‘

I had to open a PR to fragile because it was pulling in the plangym dependency in the core library (and with it pillow-simd)

Here's the PR that implements your gist: #39

from mathy.

justindujardin avatar justindujardin commented on July 1, 2024

@all-contributors please add @Guillemdb for code

from mathy.

allcontributors avatar allcontributors commented on July 1, 2024

@justindujardin

I've put up a pull request to add @Guillemdb! πŸŽ‰

from mathy.

justindujardin avatar justindujardin commented on July 1, 2024

Thanks for your help @Guillemdb!

I had some trouble with the ParallelEnv wrapper, so I removed it for now. When I used it I got an error about FragileEnvironment doesn't have a __call__ method:

def swarm_solve(problem: str, config: SwarmConfig):
    env_callable = lambda: FragileMathyEnv(
        name="mathy_v0", problem=problem, repeat_problem=True
    )
    mathy_env: MathyEnv = env_callable()._env._env.mathy
    if config.use_mp:
        env_callable = ParallelEnv(env_callable=env_callable)
    swarm = Swarm(
        model=lambda env: DiscreteMasked(env=env),
        env=env_callable,
        reward_limit=EnvRewards.WIN,
        n_walkers=config.n_walkers,
        max_epochs=config.max_iters,
        reward_scale=1,
        distance_scale=3,
        distance_function=mathy_dist,
        show_pbar=False,
    )

If it's helpful for you I can reproduce the error again, otherwise, I'll just leave the Parallel runner out for the moment since I'm short on time.

I also had the all-contributors bot add you to the contributor list because of your fragile and gist contributions. This means you'll show up on the site and in the GitHub readme:

from mathy.

github-actions avatar github-actions commented on July 1, 2024

πŸŽ‰ This issue has been resolved in version 0.7.9 πŸŽ‰

The release is available on GitHub release

Your semantic-release bot πŸ“¦πŸš€

from mathy.

Guillemdb avatar Guillemdb commented on July 1, 2024

@justindujardin this is my fault, I made a mistake gist where I showed you how to define the parallel environment.

It should also be passed as an env_callable just like a regular environment with lambda: ParallelEnv(env_callable=env_callable), but I will be adding a __call__ method to avoid having to create a lambda function. Thanks fot the idea.

@justindujardin

I've put up a pull request to add @Guillemdb! tada

Thank you man! I really appreciate it. I am sorry I couldn't help you more this weekend.

from mathy.

justindujardin avatar justindujardin commented on July 1, 2024

Thanks for the mp fix! I restored the functionality in #42 πŸ‘

from mathy.

Related Issues (12)

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.