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

子类化构建模型 #34

Open
Student-HXJ opened this issue Apr 24, 2020 · 1 comment
Open

子类化构建模型 #34

Student-HXJ opened this issue Apr 24, 2020 · 1 comment

Comments

@Student-HXJ
Copy link

你好,请问我在用子类化方法构建模型的时候,想将该模型嵌入另一个子类化模型中,
第一种方式是将嵌入的模型写成继承Layer类的方法,然后重写get_config 方法,
第二种方式是将嵌入的模型写成继承Model类的方法重写compute_output_shape方法。

请问这两种方法效果是否是一样的?或者有什么区别?

@lyhue1991
Copy link
Owner

@Student-HXJ 尽可能避免用子类化方法构建模型。特殊情况下如果有必要,可以自定义Layer. 详情可以参考项目中相关内容呢!

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

No branches or pull requests

2 participants