Closed johnarevalo closed 8 years ago
LOL. Well yes this does seem like a big improvement, thanks.
You'll need to import six.moves.queue.PriorityQueue
to fix your code for Python 3. The Queue
module is deprecated.
That plus the linter fix:
blocks/extras/extensions/plot.py:171:1: E302 expected 2 blank lines, found 1
preferably with a rebase+squash, and I think this is ready to merge.
I've fix them. There is, however, an issue with Checkpoint
extension since Thread
class is not serializable. I could follow this approach. But in any case, I don't know how useful could be save Plot
object at all.
It is definitely useful, because it allows full resumability of the experiments, which has high priority for Blocks.
On 26 October 2015 at 11:15, John Arevalo notifications@github.com wrote:
I've fix them. There is, however, an issue with Checkpoint extension since Thread class is not serializable. I could follow this approach https://github.com/mila-udem/blocks/blob/58994253579d30fb63a2cfa53499a68b1237c3c0/blocks/extensions/__init__.py#L442. But in any case, I don't know how useful could be save Plot object at all.
— Reply to this email directly or view it on GitHub https://github.com/mila-udem/blocks-extras/pull/30#issuecomment-151170064 .
Yes, I would recommend using __getstate__
to delete the thread object
from the returned dict or whatever.
A pattern I like for this is to put all the initialization of the thread in a property, which checks for an existing underscore-prefixed attribute and creates it on demand if it doesn't exist. Thus the thread creation logic can go in one place and you don't need to call a function to initialize it, you just use self.thread or whatever wherever you need it.
On Oct 26, 2015 11:15 AM, "John Arevalo" notifications@github.com wrote:
I've fix them. There is, however, an issue with Checkpoint extension since Thread class is not serializable. I could follow this approach. But in any case, I don't know how useful could be save Plot object at all.
— Reply to this email directly or view it on GitHub.
Sorry, I rebase before read your last comment. I will use property pattern and rebase again.
@dwf @rizar rebased.
I've updated the PR. I have a doubt with the expected behavior for a resumed Plot
extension. Should it keep adding points to the last plot?. This PR as well as the master
branch overwrite the plot in the bokeh server, i.e. reset "iterations" counter to 1. Edited: @dwf, @rizar I don't know if you were notified.
Sorry this has been languishing. I will take a look at it.
LGTM, thanks!
Plot
extension slows down the training time for small datasets. It happens when batch processing is faster thanstore_objects()
/push()
actions to the bokeh server. This is the profiling for a softmax training with the Iris dataset. :This is the profiling when
push()
are called from a separate thread:The time in
Training
section decreases from69.52
to3.53
seconds.