Comments (14)
Ok great, I will add that. I'm using it in another project, and I think it should be fairly simple. I also have a working implementation of live updating plot that shows progress per epoch so will include both in the same update. It seems the progress bar should be a parameter so it can be turned off (maybe on by default?).
from talos.
Sorry missed the question when I read your comment the first time. Yes I think it is standard to have a toggle for it. There must be an easy way to do that with tqdm if that's what you're using. Its important that you mentioned this since some notebooks (Google Colab...) do not play nicely with tqdm!
from talos.
Tried this and unfortunately it's going to be a little complicated.
The way the loop is handled now:
if self.round_limit is not None:
for i in range(self.round_limit):
self._null = self._run()
else:
while len(self.param_log) != 0:
self._null = self._run()
Out of these two the more common case is the else where round_limit is not set (second case). The first case is very simple and a standard use-case for tqdm. The second case is problematic in the sense that if a reduction method is applied, then the self.param_log keeps becoming smaller faster than 1 per iteration. Not to say that this is not possible to implement, but is not going to be as simple as I hoped. The question that would need to be answered is related with how to handle the case where a reducer is used; for example you might have 20 hours to start with, and then it jumps down to 10, then to 2, and so on...and in the process it might not also be so accurate as there is a great degree of variety depending on the hyperparameters.
from talos.
I think I understand. There should be ways to manually update the progress bar. Here's an example (I didn't test it yet).
I can look into this in more detail sometime later as well!
Edit: also, I think just having more or less an indicator of the amount of progress Scan
has made is desirable, even independent of the estimated time until the process finishes. (I just like to know something is happening in the background!).
from talos.
@x94carbone re 'Edit' > great. I was thinking like that as well. I think there are two sides to this; something that serves the purpose of terminal and notebook use, and then secondarily for the notebook use only. For notebook it seems that a live updating matplotlib plot is an idea situation as you can also see epoch level updates (and get an idea of how the training takes place which can be really valuable especially early in the process or an automated reduction/optimization method is used). How about a very simple x out of xxx rounds left for the universal case?
from talos.
@mikkokotila right I totally agree. There's got to be an easy way for the program to detect whether or not its running in a notebook or not. Regardless, since there are some notebooks that don't play nice with these progress bars, we should implement some default behavior first. Something like what you suggested should work great! Particularly, maybe something that constantly overwrites the first output line so we don't overwhelm the user with a ton of output.
from talos.
@x94carbone what do you think, can we assume that the user is not going to want to have verbose for model.fit on anything except 0? If we can assume that, we can detect the os, and then according to the os we use a system clear command (windows cls
and otherwise clear
). Here we just accept that whatever have been shown on the terminal / notebook will be cleared. What do you think?
from talos.
We might not even have to make it that complicated actually- I may have been overthinking it. We could implement three options and let the user choose for themselves. 0 for silent running, 1 for progress bar and 2 for raw text output. Maybe thatβs a better starting place than detecting the os or if the user is in a notebook. Then once we have that working we can go from there. What do you think?
from talos.
I have another idea actually. We don't need a progress bar, we can do this with the Python 3 print function if we're clever. Backwards compatible via from __future__ import print_function
, I think. I will give this a shot at some point soon.
from talos.
I've added tqdm which is on by default. Together with some notable changes, you can find it in dev-mikko, and hopefully tomorrow in daily-dev as well (will have to do more testing, and also add some unit tests).
from talos.
This Should Help.
Example Solution From My Experience
Configuration
If #tqdm is not already installed, install it with #pip.
pip install #tqdm
Suppose the flyer in question is called flyer, an instance of the class Flyer. Find where flyer is defined in your IPython profile. Something like:
flyer = Flyer(some_arguments)
We can subclass Flyer, customizing its collect method to incorporate a progress bar.
class FlyerWithProgressBar(Flyer):
def collect(self):
yield from tqdm(super().collect())
flyer = FlyerWithProgressBar(some_arguments
If you have some way of knowing in advance how many data points will be yielded by collect, you can provide that information to tqdm to make it more informative. (It can predict the time remaining, for example.) Suppose we have a flyer that always produces 100 data points. The class should be defined like:
class FlyerWithProgressBar(Flyer):
def collect(self):
yield from tqdm(super().collect()
Or, add an attribute that can be updated interactively: π»
from talos.
And finally it goes this way π³
interactively:
class FlyerWithProgressBar(Flyer):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # pass arguments to Flyer
self.total = 100
def collect(self):
yield from tqdm(super().collect(), total=self.total)
Here is a demo of FlyerWithProgressBar.
In [1]: from bluesky.plans import fly
In [2]: flyer = FlyerWithProgressBar()
In [3]: plan = fly([flyer])
In [4]: RE(plan)
100%|βββββββββββββββββββββββββββββββββββββββββββββββββ| 100/100 [00:01<00:00, 92.35it/s]
Out[4]: ['3acf0eb7-96bf-4c09-b813-e715dab
from talos.
That would be good if we could do it very simply! :)
from talos.
Progress bar had been added some time ago and now available in master as well as pip so closing here.
from talos.
Related Issues (20)
- talos execution fails of very first example: HOT 1
- Resume run possible? HOT 2
- Key duplication results in exception: param dict vs. csv file stored (e.g., 'loss') HOT 3
- Heatmap always have missing parts HOT 2
- Failed to build scipy while installing talos HOT 1
- Using `Evaluate` with multiple inputs HOT 6
- ImportError: cannot import name 'get_config' HOT 4
- add arguments to the function syntax HOT 1
- Using train, val data HOT 1
- Cannot replicate typical example from documentation HOT 1
- Can't find description of layer shapes HOT 3
- Talos installation stuck at downloading statsmodel HOT 1
- [RFC00102] Increase Visibility and Access to Power Draw Data HOT 1
- Getting errors when handling custom object HOT 4
- Add comprehensive support for n-dimensional `x` or `y`
- AttributeError: module 'talos.utils' has no attribute 'ExperimentLogCallback' HOT 1
- Live is not in talos HOT 1
- Advanced hyperparameter configuration HOT 1
- Error with Autom8 import HOT 1
- pip install talos is failing due to sklearn in requirements.txt instead of scikit-learn HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from talos.