Conversation
6bc7c16 to
b27a3dd
Compare
blocks/log/json.py
Outdated
| self.iteration_status = {} | ||
|
|
||
| def __setstate__(self, state): | ||
| logger = Logger(**kwargs) |
There was a problem hiding this comment.
kwargs should be self.all_kwargs I guess?
There was a problem hiding this comment.
Oops, it should be state.
|
@bartvm , seems the log writes only the last two lines to the file with an option |
|
That doesn't sound right, |
|
I fixed that problem, it was my bug. I checked locally pickling/unpickling and it works fine, but Travis doesn't like it... |
|
I think the problem is that the log doesn't get closed. Until the log gets closed, If you don't call |
|
My implementation doesn't allow to access log entries more than 3 iterations before. It seems for me as a reasonable solution for many tasks with a large log. But it means, that I cannot run all the tests (some of them are trying to check that the whole log is fine). I can see two solutions:
Neither seems nice to me, what do you prefer, guys? |
|
An alternative solution would be to make |
|
Seems, that no: In [4]: a = numpy.array(1)
In [5]: isinstance(a, numpy.generic)
Out[5]: False |
|
Right, that's not a scalar but a 0D array. I can add that case ( Just wondering, where in Blocks are 0D arrays created? Reduction operations like |
|
Also, in general I'm not sure whether the |
|
As I can see, theano always returns 0d arrays even if the function is compiled with |
|
Looks like it. Seems like an inconsistency between Theano and NumPy: In [1]: from theano import tensor
In [2]: import numpy as np
In [3]: x = tensor.vector('x')
In [4]: x.mean().eval({x: np.random.rand(10)})
Out[4]: array(0.40431822667528144)
In [5]: np.random.rand(10).mean()
Out[5]: 0.43414875634541017 |
.travis.yml
Outdated
| - python: 3.4 | ||
| env: TESTS=blocks FLOATX=float64 | ||
| - python: 2.7 | ||
| env: TESTS=blocks FLOATX=float32 DB=mimir |
There was a problem hiding this comment.
I am not sure that it is worth to run all these additional tests every time. We can at least skip Python 2.7 tests for Blocks and only do them for Blocks-examples.
There was a problem hiding this comment.
I agree, that's too much. I'll remove some tests after I'll be sure that everything works.
|
I restarted the master branch build and it also fails, Travis has some problem again, since there's no g++ somehow. |
blocks/log/json.py
Outdated
| self.status = {} | ||
| TrainingLogBase.__init__(self) | ||
| kwargs.setdefault("maxlen", 21) | ||
| kwargs.setdefault("filename", filename) |
There was a problem hiding this comment.
You don' have to do this, Python will complain if a user passes filename as a positional as well as a keyword argument.
I think it would be cleaner to just use __init__(self, filename='log.jsonl.gz', maxlen=21, formatter=None, **kwargs) though and then call PicklableLogger(filename=filename, maxlen=maxlen, formater=formatter, **kwargs). Better for default arguments to be in the signature than hidden in the code.
|
@dmitriy-serdyuk Please rebase on |
cfe9c3e to
ad4eced
Compare
757aa01 to
e8e14ce
Compare
|
@dmitriy-serdyuk Did this ever end up working? |
|
Not yet =) I promise that I'll find time to finish it. I'm starting to think that it's much easier to change the logger interface than trying to mimic the default dict. |
First working draft of a mimir logger.
kwargsduring picking and recreate logger during unpicking.@rizar , @bartvm