Skip to content
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

Updating with empty rows #1

Open
avril-affine opened this issue Aug 20, 2019 · 1 comment
Open

Updating with empty rows #1

avril-affine opened this issue Aug 20, 2019 · 1 comment

Comments

@avril-affine
Copy link

avril-affine commented Aug 20, 2019

Typically during training a DL model, there are many train losses/metrics and less validation losses/metrics. In this case, there would not be many "validation" update rows. Here is an example:

In [1]: from cox.store import Store

In [2]: store = Store('test')
Logging in: /home/panda/test/05470312-67d5-405b-ae74-d81b3b770be4

In [3]: store.add_table('metrics', {'train': float, 'val': float}
   ...: )
Out[3]: <cox.store.Table at 0x7f759f9af0b8>

In [4]: store['metrics']
Out[4]: <cox.store.Table at 0x7f759f9af0b8>

In [5]: t = store['metrics']

In [6]: t.update_row({'train': 1.23})

In [7]: t.flush_row()
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
~/anaconda3/envs/dev/lib/python3.7/site-packages/cox/store.py in flush_row(self)
    390             try:
--> 391                 assert self._curr_row_data[k] is not None
    392             except:

AssertionError:

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-7-d818515cef82> in <module>
----> 1 t.flush_row()

~/anaconda3/envs/dev/lib/python3.7/site-packages/cox/store.py in flush_row(self)
    397                     msg = 'Col %s is None!' % k
    398
--> 399                 raise ValueError(msg)
    400
    401         for k, v in self._curr_row_data.items():

ValueError: Col val is None!

Would it be possible to add an optional argument to flush_row() to allow None or would that mess things up down the line?

@lengstrom
Copy link
Member

Yes I like the option of adding an allow_none option, we'll add this feature soon!

andrewilyas pushed a commit that referenced this issue Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants