Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Issue 2548603003: Adding memoized functions (Closed)

Created:
4 years ago by wrengr
Modified:
4 years ago
CC:
chromium-reviews, infra-reviews+infra_chromium.org, aarya
Target Ref:
refs/heads/master
Project:
infra
Visibility:
Public.

Description

Adding memoized functions Memoization is necessary when training loglinear models to avoid recomputing features over and over. Recomputing features affects not just the constant factors but also the asymptotic complexity (in a way that's already observable for small ``N``). The memoization is factored out into a class because doing so greatly reduces the code complexity over doing it manually in all the places where we need it. BUG= TBR=stgao@chromium.org Committed: https://chromium.googlesource.com/infra/infra/+/d1e13b1f320c86e949a5e7310dc52b37cd1d0163

Patch Set 1 : breaking CL apart #

Patch Set 2 : Filled out the tests #

Patch Set 3 : rebase #

Total comments: 19

Patch Set 4 : Addressing nits #

Total comments: 5

Patch Set 5 : addressing nits #

Patch Set 6 : forgot if I pushed the latest before CQ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+120 lines, -1 line) Patch
A appengine/findit/libs/math/functions.py View 1 2 3 4 1 chunk +57 lines, -0 lines 0 comments Download
A appengine/findit/libs/math/test/functions_test.py View 1 2 3 4 1 chunk +62 lines, -0 lines 0 comments Download
M appengine/findit/libs/math/vectors.py View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 33 (18 generated)
wrengr
PTAL
4 years ago (2016-12-02 20:28:36 UTC) #9
Sharu Jiang
https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py File appengine/findit/libs/math/functions.py (right): https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py#newcode4 appengine/findit/libs/math/functions.py:4: nit: 2 empty lines. https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py#newcode20 appengine/findit/libs/math/functions.py:20: def __call__(self, x): ...
4 years ago (2016-12-02 23:47:18 UTC) #10
Martin Barbella
https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py File appengine/findit/libs/math/functions.py (right): https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py#newcode52 appengine/findit/libs/math/functions.py:52: # TODO(wrengr): can we remove the extra indirection somehow? ...
4 years ago (2016-12-02 23:50:22 UTC) #11
inferno
I don't see the value of adding this complexity. Can you explain the reasoning for ...
4 years ago (2016-12-05 00:02:10 UTC) #13
wrengr
https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py File appengine/findit/libs/math/functions.py (right): https://codereview.chromium.org/2548603003/diff/120001/appengine/findit/libs/math/functions.py#newcode4 appengine/findit/libs/math/functions.py:4: On 2016/12/02 23:47:18, Sharu Jiang wrote: > nit: 2 ...
4 years ago (2016-12-05 18:50:45 UTC) #16
inferno
lgtm
4 years ago (2016-12-05 18:53:59 UTC) #17
Sharu Jiang
lgtm
4 years ago (2016-12-05 19:26:27 UTC) #18
stgao
What's the most important difference of this from https://chromium.googlesource.com/infra/infra/+/cae4d6478d25b9be3607bb20989713569eae9c49/appengine/findit/lib/cache_decorator.py ? Could cache_decorator be reused here ...
4 years ago (2016-12-05 19:30:56 UTC) #20
wrengr
On 2016/12/05 19:30:56, stgao (slow on Monday) wrote: > What's the most important difference of ...
4 years ago (2016-12-05 21:10:22 UTC) #21
wrengr
https://codereview.chromium.org/2548603003/diff/160001/appengine/findit/libs/math/functions.py File appengine/findit/libs/math/functions.py (right): https://codereview.chromium.org/2548603003/diff/160001/appengine/findit/libs/math/functions.py#newcode42 appengine/findit/libs/math/functions.py:42: class MemoizedFunction(Function): On 2016/12/05 19:30:56, stgao (slow on Monday) ...
4 years ago (2016-12-05 21:23:52 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2548603003/180001
4 years ago (2016-12-05 21:24:08 UTC) #25
stgao
On 2016/12/05 21:10:22, wrengr wrote: > On 2016/12/05 19:30:56, stgao (slow on Monday) wrote: > ...
4 years ago (2016-12-05 21:29:12 UTC) #26
wrengr
On 2016/12/05 21:29:12, stgao (slow on Monday) wrote: > BTW, I have a comment in ...
4 years ago (2016-12-06 22:11:38 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2548603003/200001
4 years ago (2016-12-06 22:11:50 UTC) #30
commit-bot: I haz the power
4 years ago (2016-12-06 22:27:05 UTC) #33
Message was sent while issue was closed.
Committed patchset #6 (id:200001) as
https://chromium.googlesource.com/infra/infra/+/d1e13b1f320c86e949a5e7310dc52...

Powered by Google App Engine
This is Rietveld 408576698