Giter Club home page Giter Club logo

Comments (6)

patrick-kidger avatar patrick-kidger commented on May 16, 2024 2

That was fast! First class support, right there. :D

from pysr.

patrick-kidger avatar patrick-kidger commented on May 16, 2024 1

Ah, I see; in particular the Python-Julia interop. (Which sounds like no fun at all, I don't envy you.) I think my preferred option would be for a flag that puts the optional file in the same temporary directory.

from pysr.

MilesCranmer avatar MilesCranmer commented on May 16, 2024

Great question; I should add a temporary file option. Note generally you can set the filename of this csv file to whatever you like with the equation_file argument (overwrites by default). Here are some notes on this behaviour:

  • I completely de-couple Python and Julia. Their only communication is via writing files to disk. This is because I found that PyJulia made distributed compute difficult to set up (and perhaps impossible for multi-node), so instead I just have Python basically meta-program a SymbolicRegression.jl program and run Julia on it. (also much easier to sort out PATH issues this way).
  • Because of this, the Python actually requires the hall of fame csv file to read back the best equations from Julia.
  • For all temporary files other than the equations file, I write to a temp directory that is deleted at the end of training (can turn this off with delete_tempfiles=False). This is made system independent with the tempfile module.

However, for the hall of fame file, I use the current directory by default, and append the datetime so there is a new file for each run. But one can manually set the location with eg equation_file="equations.csv". This will overwrite whatever file is there. You could use Sacred on that filename, maybe?

So that's one option. The other option, which I don't have yet, is to make an optional flag to just put the equations file into the same temporary directory so it gets deleted after training.

Thoughts?
Cheers,
Miles

from pysr.

MilesCranmer avatar MilesCranmer commented on May 16, 2024

Sounds good, will add it!

from pysr.

MilesCranmer avatar MilesCranmer commented on May 16, 2024

Okay, pushed to master! Will update PyPI soon. Setting temp_equation_file=True will now put the hall of fame file into the temporary directory. It will be deleted by default, or you can choose to keep the temp directory with delete_tempfiles=False.

Cheers,
Miles

from pysr.

MilesCranmer avatar MilesCranmer commented on May 16, 2024

Thanks! 😄 🚀

from pysr.

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.