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

Tensorflow 1.x backend: layer-by-layer dropout rate setting for DeepONet #1792

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vl-dud
Copy link
Contributor

@vl-dud vl-dud commented Jul 3, 2024

Now you can set dropout_rate more flexibly:

net = dde.nn.DeepONet(
    [10, 128, 128, 128],
    [dim_x, 128, 128, 128],
    "tanh",
    "Glorot normal",
    dropout_rate={
        "branch": [0.5, 0.3],
        "trunk": [0.5, 0.3, 0.2]
    },
)

@lululxvi
Copy link
Owner

lululxvi commented Jul 6, 2024

There are a lot of code like this

if isinstance(self.dropout_rate_branch, list):

To simplify the code, you can convert the single dropout to a list as well. Then in the code, there is no need to use if to check.

@vl-dud
Copy link
Contributor Author

vl-dud commented Jul 7, 2024

Fixed

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