Skip to content

[calvo_machine_learn] Replace np.sum(a * b) with a @ b #214

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

Merged
merged 2 commits into from
Aug 5, 2025

Conversation

suda-yuga
Copy link
Contributor

Replace np.sum(a * b) and jnp.sum(a * b) with a @ b
QuantEcon/lecture-python.myst#463

@@ -567,7 +567,7 @@ def compute_θ(μ, α=1):

# Compute the weighted sums for all t
weighted_sums = jnp.array(
[jnp.sum(λ_powers[:T-t] * μ[t:T]) for t in range(T)])
Copy link
Contributor

Choose a reason for hiding this comment

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

@HumphreyYang should we do this for jnp.sum as well as np.sum?

Copy link
Member

Choose a reason for hiding this comment

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

Many thanks @mmcky, I think it's fine because they behave similarly.

I will do another pass over every lecture once the preview PR is opened!

Copy link
Contributor

Choose a reason for hiding this comment

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

thanks @HumphreyYang this is building now
#219

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll merge this in and then update #219

@mmcky mmcky merged commit 4d02fd3 into QuantEcon:main Aug 5, 2025
5 checks passed
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.

3 participants