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

Spinachboul update function #457

Closed
wants to merge 12 commits into from
4 changes: 2 additions & 2 deletions docs/src/tensor_prod.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Tensor product function
The tensor product function is defined as:
``f(x) = \prod_{i=1}^d \cos(a\pi x_i)``
The tensor product function is defined as: ```\[ f(x) = ∏ᵢ=₁ᵈ cos(aπxᵢ) \]```
Copy link
Member

Choose a reason for hiding this comment

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

But this isn't correct. This is one example of a tensor product.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, that is true. Maybe we specifically say it is one of the possible forms. I think this was taken from https://smt.readthedocs.io/en/latest/_src_docs/problems/tensorproduct.html

Copy link
Contributor Author

@Spinachboul Spinachboul Jan 4, 2024

Choose a reason for hiding this comment

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

Well, @ChrisRackauckas and @sathvikbhagavan
Should we properly define the tensor product function like this:
equation

Or just stating this example would be fine??

Copy link
Member

Choose a reason for hiding this comment

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

Yes that would do it. But do we have an actual issue that is being solved here?

Copy link
Member

Choose a reason for hiding this comment

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

As the benchmarks need some cleanup, I think we can startoff with this PR to clean up the tensor product benchmark? Although I am not sure why would we need a surrogate for computing tensor product 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sathvikbhagavan
I think there would be a couple of factors as to why surrogates could be used to compute tensor product:

  • Computational Complexity would be decreased
  • Efficient memory handling
  • Normalization of products of tensors which provide numerical stability

This PR #457 only consists of changing the example of tensor product into a more readable form up till now, but I would also work towards explaining the mathematical concepts behind surrogate models in my draft PR as we discussed earlier.


Let's import Surrogates and Plots:
```@example tensor
Expand Down Expand Up @@ -38,3 +37,4 @@ plot!(xs,f.(xs), label="True function", legend=:top)
plot!(xs, loba_1.(xs), label="Lobachevsky", legend=:top)
plot!(xs, krig.(xs), label="Kriging", legend=:top)
```