Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Cleanup: broadcasting#7562
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -25,7 +25,7 @@ | ||
| # Generate random data | ||
| data=np.random.uniform(0,1, (64,75)) | ||
| X=np.linspace(-1,1,data.shape[-1]) | ||
| G=1.5*np.exp(-4*X**2) | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. In most cases I think this construct is marginally faster. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. (and you can easily get them reversed on another run). Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. interesting. That is an apparently wrong rule of thumb I have been using for a while. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Why would you think this would be the case? (I am honestly puzzled.) Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It dates back to the early days of computers and compilers, when computers were slow and compilers were not so bright. Multiplication is faster than taking a power, in general. But now compilers recognize things like this and find the best algorithm. In the case of numpy, I'm pretty sure there is explicit internal optimization of small integer powers so that we wouldn't have to use that ancient manual optimization. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I respectfully request the children remain off of my lawn. 😈 Contributor
| ||
| # Generate line plots | ||
| lines= [] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -9,7 +9,7 @@ | ||
| importmatplotlib.pyplotasplt | ||
| t=np.arange(0.0,1.0+0.01,0.01) | ||
| s=np.cos(2*2*np.pi*t) | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Just curious: why isthis the one where you don't have spaces around it? Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. nm...I guess I see it now. | ||
| t[41:60]=np.nan | ||
| plt.subplot(2,1,1) | ||
Uh oh!
There was an error while loading.Please reload this page.