-
Notifications
You must be signed in to change notification settings - Fork 646
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
Add Metaheac model #788
Add Metaheac model #788
Conversation
runner: | ||
train_data_dir: "./data/train" | ||
train_reader_path: "reader_train" # importlib format | ||
use_gpu: True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demo数据需要使用cpu,方便没有gpu机器的用户体验
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
epochs: 1 | ||
print_interval: 100 | ||
#model_init_path: "output_model_esmm/2" # init model | ||
model_save_path: "output_model_esmm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
保存路径和加载路径需要换成自己模型名字,然后全量数据后面要加“_all”以和demo数据的保存路径区分
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
epochs: 1 | ||
print_interval: 100 | ||
#model_init_path: "output_model_esmm/2" # init model | ||
model_save_path: "output_model_esmm" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
保存和加载路径需要换成自己模型的名字
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
return metrics_list, metrics_list_name | ||
|
||
# construct train forward phase | ||
def train_forward(self, dy_model, metric_list, batch, config): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里多加一些注释吧,以方便更多用户能够看懂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
|
||
## 快速开始 | ||
本文提供了样例数据可以供您快速体验,在任意目录下均可执行。在MetaHeac模型目录的快速执行命令如下: | ||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
md模式下不需要命令前的“!”或者“%”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
models/multitask/metaheac/readme.md
Outdated
!python -W ignore -u ../../../tools/trainer.py -m config.yaml | ||
# 动态图预测 | ||
# step2: infer 此时test数据集为hot | ||
!python -W ignore -u ../../../tools/infer_meta.py -m config.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要添加-W ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
models/multitask/metaheac/readme.md
Outdated
``` | ||
|
||
## 模型组网 | ||
模型整体结构如下: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请补全这一板块
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
|:------|:-------| :------ | :------| :------ | | ||
| MetaHeac | 0.7112 | 1024 | 1 | 3个小时左右 | | ||
|
||
```bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非AI Studio的notebook环境,可以不加“!”等符号
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
models/multitask/metaheac/readme.md
Outdated
# step2: infer 此时test数据集为hot | ||
!python -W ignore -u ../../../tools/infer_meta.py -m config.yaml | ||
# step3:修改config文件中test文件的路径为cold | ||
# !python -W ignore -u ../../../tools/infer_meta.py -m config.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里需要对infer_meta.py有更详细的说明,然后路径为cold和hot的区别需要在readme中写明
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已在readme.md中添加相应说明
tools/infer_meta.py
Outdated
dy_model.clear_gradients() | ||
loss.backward() | ||
optimizer.step() | ||
# 对每个子任务进行测试 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以将元学习专属infer的作用和使用方式更新到tools目录下的readme中,方便其他用户快速看动
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已在metaheac目录下readme.md中添加相应说明
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
还需要添加中英文的主页readme表格,contributor.md贡献者表格,doc/source下的目录结构和文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tipc可以看一下是否能够添加
PR Add new model metaheac;
PR
Add new model metaheac;
Add new tools infer_meta.py;