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

🐛[BUG]: How to use the Stan activation function #158

Open
YouqiongLiu opened this issue Jul 1, 2024 · 1 comment
Open

🐛[BUG]: How to use the Stan activation function #158

YouqiongLiu opened this issue Jul 1, 2024 · 1 comment
Labels
? - Needs Triage Need team to review and classify bug Something isn't working

Comments

@YouqiongLiu
Copy link

Version

nvidia-modulus: 0.4.0 nvidia-modulus.sym:1.3.0

On which installation method(s) does this occur?

Pip

Describe the issue

Using the Stan activation function according to the URL: https://github.com/NVIDIA/modulus-sym/blob/main/examples/helmholtz/conf/config_stan , an error message appears.
Please provide an example of Stan activation, such as examples/helmholtz/helmholtz_stan.py mentioned in the instructions for use.

Minimum reproducible example

No response

Relevant log output

def forward(self, x):
        if x.shape[-1] != self.beta.shape[-1]:
            raise ValueError(
            ~~~~~~~~~~~~~~~~~
                f"The last dimension of the input must be equal to the dimension of Stan parameters. Got inputs: {x.shape}, params: {self.beta.shape}"
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
            )
        return torch.tanh(x) * (1.0 + self.beta * x)
builtins.ValueError: The last dimension of the input must be equal to the dimension of Stan parameters. Got inputs: [2000, 256], params: [4]

Environment details

No response

Other/Misc.

No response

@YouqiongLiu YouqiongLiu added ? - Needs Triage Need team to review and classify bug Something isn't working labels Jul 1, 2024
@HannnZH
Copy link

HannnZH commented Jul 5, 2024

Same issue here, I see from the documnetation page that there is supposed to be a example with helmholtz equation but there is nothing in the example folder.

An example for Stan activation is provided by examples/helmholtz/helmholtz_stan.py. As shown in Fig. 14, one can see that Stan activation yields faster convergence and better validation accuracy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
? - Needs Triage Need team to review and classify bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants