Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
226aaef9
Unverified
Commit
226aaef9
authored
Jan 07, 2020
by
Chi Song
Committed by
GitHub
Jan 07, 2020
Browse files
Chinese Translation (#1914)
parent
ae81ec47
Changes
52
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
71 additions
and
21 deletions
+71
-21
examples/nas/darts/README_zh_CN.md
examples/nas/darts/README_zh_CN.md
+1
-0
examples/nas/enas/README_zh_CN.md
examples/nas/enas/README_zh_CN.md
+1
-0
examples/nas/naive/README_zh_CN.md
examples/nas/naive/README_zh_CN.md
+1
-0
examples/nas/pdarts/README_zh_CN.md
examples/nas/pdarts/README_zh_CN.md
+1
-0
examples/nas/spos/README_zh_CN.md
examples/nas/spos/README_zh_CN.md
+1
-0
examples/nas/textnas/README_zh_CN.md
examples/nas/textnas/README_zh_CN.md
+45
-0
examples/trials/README_zh_CN.md
examples/trials/README_zh_CN.md
+2
-2
examples/trials/cifar10_pytorch/README_zh_CN.md
examples/trials/cifar10_pytorch/README_zh_CN.md
+2
-2
examples/trials/ga_squad/README_zh_CN.md
examples/trials/ga_squad/README_zh_CN.md
+6
-6
examples/trials/kaggle-tgs-salt/README_zh_CN.md
examples/trials/kaggle-tgs-salt/README_zh_CN.md
+1
-1
examples/trials/network_morphism/README_zh_CN.md
examples/trials/network_morphism/README_zh_CN.md
+7
-7
tools/nni_annotation/README_zh_CN.md
tools/nni_annotation/README_zh_CN.md
+3
-3
No files found.
examples/nas/darts/README_zh_CN.md
0 → 100644
View file @
226aaef9
[
文档
](
https://nni.readthedocs.io/zh/latest/NAS/DARTS.html
)
examples/nas/enas/README_zh_CN.md
0 → 100644
View file @
226aaef9
[
文档
](
https://nni.readthedocs.io/zh/latest/NAS/ENAS.html
)
examples/nas/naive/README_zh_CN.md
0 → 100644
View file @
226aaef9
这是一个简单示例,演示如何使用 NNI 接口实现 NAS 搜索空间。
\ No newline at end of file
examples/nas/pdarts/README_zh_CN.md
0 → 100644
View file @
226aaef9
[
文档
](
https://nni.readthedocs.io/zh/latest/NAS/PDARTS.html
)
examples/nas/spos/README_zh_CN.md
0 → 100644
View file @
226aaef9
[
文档
](
https://nni.readthedocs.io/zh/latest/NAS/SPOS.html
)
examples/nas/textnas/README_zh_CN.md
0 → 100644
View file @
226aaef9
# TextNAS: A Neural Architecture Search Space tailored for Text Representation
TextNAS 由 MSRA 提出 正式版本。
[
论文链接
](
https://arxiv.org/abs/1912.10729
)
## 准备
准备词向量和 SST 数据集,并按如下结构放到 data 目录中:
```
textnas
├── data
│ ├── sst
│ │ └── trees
│ │ ├── dev.txt
│ │ ├── test.txt
│ │ └── train.txt
│ └── glove.840B.300d.txt
├── dataloader.py
├── model.py
├── ops.py
├── README.md
├── search.py
└── utils.py
```
以下链接有助于查找和下载相应的数据集:
*
[
GloVe: Global Vectors for Word Representation
](
https://nlp.stanford.edu/projects/glove/
)
*
[
Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank
](
https://nlp.stanford.edu/sentiment/
)
## 搜索
```
python search.py
```
在每个搜索 Epoch 后,会直接测试 10 个采样的结构。 10 个 Epoch 后的性能预计为 40% - 42%。
默认情况下,20 个采样结构会被导出到
`checkpoints`
目录中,以便进行下一步处理。
## 重新训练
待完成
examples/trials/README_zh_CN.md
View file @
226aaef9
...
...
@@ -6,7 +6,7 @@
**1) 写好原始的训练代码**
。
Trial 的代码可以是任何能在本机运行的机器学习代码。 这里使用
`mnist-keras. py`
作为
样
例:
Trial 的代码可以是任何能在本机运行的机器学习代码。 这里使用
`mnist-keras. py`
作为
示
例:
```
python
import
argparse
...
...
@@ -163,7 +163,7 @@ def train(args, params):
...
```
这是完整
的样
例:
这是完整
示
例:
```
python
import
argparse
...
...
examples/trials/cifar10_pytorch/README_zh_CN.md
View file @
226aaef9
此
样
例需要安装 Pytorch。 Pytorch 安装包需要选择所基于的 Python 和 CUDA 版本。
此
示
例需要安装 Pytorch。 Pytorch 安装包需要选择所基于的 Python 和 CUDA 版本。
以下是 python==3.5 和 cuda == 8.0 下的环境样例,使用下列命令来安装 Pytorch: python3 -m pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp35-cp35m-linux_x86_64.whl python3 -m pip install torchvision
\ No newline at end of file
以下是 python==3.5 和 cuda == 8.0 下的环境示例,使用下列命令来安装 Pytorch: python3 -m pip install http://download.pytorch.org/whl/cu80/torch-0.4.1-cp35-cp35m-linux_x86_64.whl python3 -m pip install torchvision
\ No newline at end of file
examples/trials/ga_squad/README_zh_CN.md
View file @
226aaef9
# 在阅读理解上使用自动模型架构搜索
该
样
例展示了如何使用遗传算法为阅读理解任务找到好的模型架构。
该
示
例展示了如何使用遗传算法为阅读理解任务找到好的模型架构。
## 搜索空间
...
...
@@ -20,9 +20,9 @@
另一个时间更快,性能更好的版本正在开发中。 很快将发布。
# 如何运行此
样
例?
# 如何运行此
示
例?
## 在本机或远程上运行此
样
例
## 在本机或远程上运行此
示
例
### 使用下载脚本来下载数据
...
...
@@ -82,7 +82,7 @@
nnictl create --config ~/nni/examples/trials/ga_squad/config.yml
## 在 OpenPAI 上运行此
样
例
## 在 OpenPAI 上运行此
示
例
根据上传大小的限制,仅上传源代码,并在训练过程中下载数据。 本 Experiment 需要的内存
`memoryMB >= 32G`
,训练过程可能需要数小时。
...
...
@@ -139,7 +139,7 @@
## 实现方法
基于进化算法架构的问答和其它
样
例一样,有两个部分:Trial 和 Tuner。
基于进化算法架构的问答和其它
示
例一样,有两个部分:Trial 和 Tuner。
### Trial
...
...
@@ -245,7 +245,7 @@ Tuner 比 Trial 代码简单很多。 它们共用了同样的 `graph.py`。 此
## 模型配置格式
这是模型配置的
样
例,在架构搜索过程中,从 Tuner 传入 Trial 的代码。
这是模型配置的
示
例,在架构搜索过程中,从 Tuner 传入 Trial 的代码。
{
"max_layer_num": 50,
...
...
examples/trials/kaggle-tgs-salt/README_zh_CN.md
View file @
226aaef9
## Kaggle 比赛 [TGS Salt Identification Chanllenge](https://www.kaggle.com/c/tgs-salt-identification-challenge) 第 33 名的解决方案
此样
例展示了如何
在没有任何代码改动
的情况下通过 NNI 来为竞赛代码使用自动机器学习。 要在 NNI 上运行此代码,首先需要单独运行它,然后配置 config.yml:
本示
例展示了如何
不改动代码
的情况下通过 NNI 来为竞赛代码使用自动机器学习。 要在 NNI 上运行此代码,首先需要单独运行它,然后配置 config.yml:
nnictl create --config config.yml
...
...
examples/trials/network_morphism/README_zh_CN.md
View file @
226aaef9
# 在 NNI 中用网络形态算法来进行自动模型结构搜索
Network Morphism (网络形态)是内置的 Tuner,它使用了网络形态技术来搜索和评估新的网络结构。 该
样
例展示了如何使用它来为深度学习找到好的模型架构。
Network Morphism (网络形态)是内置的 Tuner,它使用了网络形态技术来搜索和评估新的网络结构。 该
示
例展示了如何使用它来为深度学习找到好的模型架构。
## 如何运行此
样
例?
## 如何运行此
示
例?
### 1. 训练框架支持
...
...
@@ -58,7 +58,7 @@ trial:
### 4. 在代码中调用 "json\_to\_graph()" 函数
修改代码来调用 "json
\_
to
\_
graph()" 函数来从收到的 JSON 字符串生成一个 Pytorch 或 Keras 模型。 简单
样
例:
修改代码来调用 "json
\_
to
\_
graph()" 函数来从收到的 JSON 字符串生成一个 Pytorch 或 Keras 模型。 简单
示
例:
```
python
import
nni
...
...
@@ -91,18 +91,18 @@ nni.report_final_result(best_acc)
nnictl create
--config
config.yml
```
## Trial
样
例
## Trial
示
例
下面的代码可在
`examples/trials/network_morphism/`
中找到。 可参考此代码来更新自己的任务。 希望它对你有用。
### FashionMNIST
`Fashion-MNIST`
是来自
[
Zalando
](
https://jobs.zalando.com/tech/
)
文章的图片 — 有 60,000 个
样
例的训练集和 10,000 个
样
例的测试集。 每个
样
例是 28x28 的灰度图,分为 10 个类别。 由于 MNIST 数据集过于简单,该数据集现在开始被广泛使用,用来替换 MNIST 作为基准数据集。
`Fashion-MNIST`
是来自
[
Zalando
](
https://jobs.zalando.com/tech/
)
文章的图片 — 有 60,000 个
示
例的训练集和 10,000 个
示
例的测试集。 每个
示
例是 28x28 的灰度图,分为 10 个类别。 由于 MNIST 数据集过于简单,该数据集现在开始被广泛使用,用来替换 MNIST 作为基准数据集。
这里有两个
样
例,
[
FashionMNIST-keras.py
](
./FashionMNIST/FashionMNIST_keras.py
)
和
[
FashionMNIST-pytorch.py
](
./FashionMNIST/FashionMNIST_pytorch.py
)
。 注意,在
`config.yml`
中,需要为此数据集修改
`input_width`
为 28,以及
`input_channel`
为 1。
这里有两个
示
例,
[
FashionMNIST-keras.py
](
./FashionMNIST/FashionMNIST_keras.py
)
和
[
FashionMNIST-pytorch.py
](
./FashionMNIST/FashionMNIST_pytorch.py
)
。 注意,在
`config.yml`
中,需要为此数据集修改
`input_width`
为 28,以及
`input_channel`
为 1。
### Cifar10
`CIFAR-10`
数据集
[
Canadian Institute For Advanced Research
](
https://www.cifar.ca/
)
是广泛用于机器学习和视觉算法训练的数据集。 它是机器学习领域最广泛使用的数据集之一。 CIFAR-10 数据集包含了 60,000 张 32x32 的彩色图片,分为 10 类。
这里有两个样例,
[
cifar10-keras.py
](
./cifar10/cifar10_keras.py
)
和
[
cifar10-pytorch.py
](
./cifar10/cifar10_pytorch.py
)
。 在
`config.yml`
中,该数据集
`input_width`
的值是 32,并且
`input_channel`
是 3。
\ No newline at end of file
这里有两个示例,
[
cifar10-keras.py
](
./cifar10/cifar10_keras.py
)
和
[
cifar10-pytorch.py
](
./cifar10/cifar10_pytorch.py
)
。 在
`config.yml`
中,该数据集
`input_width`
的值是 32,并且
`input_channel`
是 3。
\ No newline at end of file
tools/nni_annotation/README_zh_CN.md
View file @
226aaef9
...
...
@@ -4,14 +4,14 @@
为了获得良好的用户体验并减少对以后代码的影响,NNI 设计了通过 Annotation(标记)来使用的语法。 通过 Annotation,只需要在代码中加入一些注释字符串,就能启用 NNI,完全不影响代码原先的执行逻辑。
样
例如下:
示
例如下:
```
python
'''@nni.variable(nni.choice(0.1, 0.01, 0.001), name=learning_rate)'''
learning_rate
=
0.1
```
此
样
例中,NNI 会从 (0.1, 0.01, 0.001) 中选择一个值赋给 learning_rate 变量。 第一行就是 NNI 的 Annotation,是 Python 中的一个字符串。 接下来的一行需要是赋值语句。 NNI 会根据 Annotation 行的信息,来给这一行的变量赋上相应的值。
此
示
例中,NNI 会从 (0.1, 0.01, 0.001) 中选择一个值赋给 learning_rate 变量。 第一行就是 NNI 的 Annotation,是 Python 中的一个字符串。 接下来的一行需要是赋值语句。 NNI 会根据 Annotation 行的信息,来给这一行的变量赋上相应的值。
通过这种方式,不需要修改任何代码,代码既可以直接运行,又可以使用 NNI 来调参。
...
...
@@ -43,7 +43,7 @@ NNI 支持如下 10 种类型来表示搜索空间:
- `@nni.variable(nni.lognormal(mu, sigma),name=variable)` 变量值分布的公式为: exp(normal(mu, sigma))
- `@nni.variable(nni.qlognormal(mu, sigma, q),name=variable)` 变量值分布的公式为: round(exp(normal(mu, sigma)) / q) * q
样
例如下:
示
例如下:
```python
'''@nni.variable(nni.choice(0.1, 0.01, 0.001), name=learning_rate)'''
...
...
Prev
1
2
3
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment