-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use in script with BlockingRunner: get log and/or feedback on progress #436
Comments
basnijholt
added a commit
that referenced
this issue
Aug 20, 2023
basnijholt
added a commit
that referenced
this issue
Aug 20, 2023
@bonh, that is currently not available, however, I just opened #441 to add this. Use like:
import adaptive
import asyncio
import random
offset = random.uniform(-0.5, 0.5)
def peak(x, offset=offset, wait=True):
from random import random
from time import sleep
a = 0.01
if wait:
# we pretend that this is a slow function
sleep(random())
return x + a**2 / (a**2 + (x - offset) ** 2)
learner = adaptive.Learner1D(peak, bounds=(-1, 1))
runner = adaptive.Runner(learner, loss_goal=0.01)
async def run(runner, fname: str):
runner.live_info_terminal(overwrite_previous=True)
await runner.task
runner.learner.save(fname)
runner.ioloop.run_until_complete(run(runner, "learner.pkl")) |
7 tasks
Sry, I got distracted. Thanks for the suggestion! I hope to try it soon. |
basnijholt
added a commit
that referenced
this issue
Feb 13, 2024
perfect, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a notebook, I can use
live_info()
to display the progress. Is something similar available if I runadaptive
in a script?The text was updated successfully, but these errors were encountered: