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

update PhyGeoNet #731

Merged
merged 8 commits into from
Jan 3, 2024
Merged

Conversation

zhiminzhang0830
Copy link
Collaborator

PR types

Others

PR changes

Others

Describe

更新PhyGeoNet案例代码
TODO:更新案例文档

Copy link

paddle-bot bot commented Jan 1, 2024

Thanks for your contribution!

Copy link
Collaborator

Choose a reason for hiding this comment

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

code部分形如:XXX = cfg.xxx的冗余代码可以都优化一下,直接用cfg.xxx即可

"iters_per_epoch": iters_per_epoch,
"num_workers": 0,
},
ppsci.loss.FunctionalLoss(lambda out, label, weught: out["mRes"]),
Copy link
Collaborator

Choose a reason for hiding this comment

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

weught->weight

)
sup_constraint = {sup_constraint_mres.name: sup_constraint_mres}

def _transform_out(_input, _output, pad_singleside=pad_singleside):
Copy link
Collaborator

Choose a reason for hiding this comment

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

加一下type-hint以及docstring

Comment on lines 8 to 11
from utils import dfdx
from utils import dfdy
from utils import setAxisLabel
from utils import visualize
Copy link
Collaborator

Choose a reason for hiding this comment

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

改为import util+utils.xxx的调用方式


def _transform_out(_input, _output, pad_singleside=pad_singleside):
output_v = _output["outputV"]
Jinv = _input["jinvs"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Jinv变量改为小写

return dfdx


def dfdy(f, dxdxi, dxdeta, Jinv, h=0.01):
Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

return dfdy


def setAxisLabel(ax, type):
Copy link
Collaborator

Choose a reason for hiding this comment

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

函数名使用小写,并用单下划线分隔单词

raise ValueError("The axis type only can be reference or physical")


def gen_e2vcg(x):
Copy link
Collaborator

Choose a reason for hiding this comment

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

e2vcg意义不明,在docstring中补上说明

return ax, cbar


def tikzplotlib_fix_ncols(obj):
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个函数好像没用到,可以删除?

e2vcg[:, j * nelemx + i] = np.asarray(
[j * nnx + i, j * nnx + i + 1, (j + 1) * nnx + i, (j + 1) * nnx + i + 1]
)
return e2vcg.astype("int")
Copy link
Collaborator

Choose a reason for hiding this comment

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

改为"int64"

@zhiminzhang0830
Copy link
Collaborator Author

@HydrogenSulfate done

Comment on lines 16 to 18
# initiallizer
ppsci.utils.misc.set_random_seed(cfg.seed)
logger.init_logger("ppsci", osp.join(cfg.output_dir, "train.log"), "info")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Comment on lines 100 to 102
logger.init_logger("ppsci", osp.join(cfg.output_dir, "eval.log"), "info")
ppsci.utils.misc.set_random_seed(cfg.seed)

Copy link
Collaborator

Choose a reason for hiding this comment

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

同上

Copy link
Collaborator

Choose a reason for hiding this comment

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

2个py文件修改一下

@zhiminzhang0830
Copy link
Collaborator Author

@HydrogenSulfate done

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@HydrogenSulfate HydrogenSulfate left a comment

Choose a reason for hiding this comment

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

LGTM

@HydrogenSulfate HydrogenSulfate merged commit 4fd32c3 into PaddlePaddle:develop Jan 3, 2024
3 checks passed
@zhiminzhang0830 zhiminzhang0830 deleted the phygeonet branch January 29, 2024 11:41
huohuohuohuohuo123 pushed a commit to huohuohuohuohuo123/PaddleScience that referenced this pull request Aug 12, 2024
* Change the directory structure

* update phygeonet code

* update heat equation code

* update heat equation with bc code

* refine phygeonet code

* add callback for seed and logger
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.

2 participants