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

only calculate loc for marginals in ipf once. #28

Merged
merged 2 commits into from
Feb 8, 2016
Merged

only calculate loc for marginals in ipf once. #28

merged 2 commits into from
Feb 8, 2016

Conversation

Eh2406
Copy link
Contributor

@Eh2406 Eh2406 commented Feb 4, 2016

This improves performance in my small test. Also reduces the number of iterations, but I'm not shore why.

@@ -52,20 +52,16 @@ def calc_diff(x, y):

iterations = 0

list_of_loc = (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably be a list comprehension instead of a generator expression. You can only iterate over generators once.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jiffyclub that explains most of the reduced iterations. :-\ Fixed.

lazy evaluation is not the intent.
jiffyclub added a commit that referenced this pull request Feb 8, 2016
only calculate loc for marginals in ipf once.
@jiffyclub jiffyclub merged commit 02a719b into UDST:master Feb 8, 2016
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

Successfully merging this pull request may close these issues.

None yet

2 participants