Skip to content

Commit

Permalink
release 0.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjiajin committed Jun 29, 2020
1 parent ddae5ff commit 1d88e74
Show file tree
Hide file tree
Showing 595 changed files with 51,891 additions and 3 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Noah Arc Lab / Huawei

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#dispatch files to site-packages
recursive-include vega *
recursive-include roma *
3 changes: 2 additions & 1 deletion README.cn.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vega 即将推出
# Vega

[English](./README.md)

Expand Down Expand Up @@ -76,3 +76,4 @@ Vega框架组件解耦,并采用注册机制来组合各个功能组件,便
## 合作和贡献

欢迎大家使用Vega,有任何疑问、求助、修改bug、贡献算法、完善文档,请在社区提交issue,我们会及时回复沟通交流。
欢迎大家加入我们的QQ群: 833345709。
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vega is coming soon
# Vega

[中文](./README.cn.md)

Expand Down Expand Up @@ -77,4 +77,5 @@ Of course, this document cannot solve all the problems. If you have any question

## Cooperation and contribution

Welcome to use Vega. If you have any questions, ask for help, fix bugs, contribute algorithms, or improve documents, submit the issue in the community. We will reply to and communicate with you in a timely manner. We hope that with our joint efforts, we can improve Vega to be a real productivity tool.
Welcome to use Vega. If you have any questions, ask for help, fix bugs, contribute algorithms, or improve documents, submit the issue in the community. We will reply to and communicate with you in a timely manner.
Welcome to join our QQ chatroom (Chinese): 833345709.
129 changes: 129 additions & 0 deletions benchmark/algs/adelaide_ea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
general:
worker:
gpus_per_job: 1

pipeline: [random1, mutate1, full1]

random1:
pipe_step:
type: NasPipeStep

dataset:
type: Cityscapes
common:
root_dir: /cache/datasets/VOC2012
train:
list_file: train.txt
batch_size: 16
num_workers: 4
shuffle: true
Rescale:
size: 512
RandomMirror: true
RandomColor:
color_factor: [0.95, 1.05]
contrast_factor: [0.95, 1.05]
brightness_factor: [0.95, 1.05]
RandomGaussianBlur:
kernel_size: 3
RandomRotation:
rotation_factor: [-10, 10]
border_value: [0.485, 0.456, 0.406]
fill_label: 255
Normalization:
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
test:
list_file: val.txt
Rescale:
size: 512
Normalization:
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]

search_space:
type: SearchSpace
modules: ['custom']
custom:
name: AdelaideFastNAS
backbone_load_path: /cache/models/mobilenet_v2-b0353104.pth
backbone_out_sizes: [24, 32, 96, 320]
op_names: [conv1x1, conv3x3, sep_conv_3x3, sep_conv_5x5, conv3x3_dil3, sep_conv_3x3_dil3, sep_conv_5x5_dil6]
agg_size: 64
aux_cell: false
sep_repeats: 1
agg_concat: true
num_classes: 21

search_algorithm:
type: AdelaideRandom
codec: AdelaideCodec
max_sample: 100

trainer:
type: Trainer
callbacks: AdelaideEATrainerCallback
codec: AdelaideCodec
seed: 0
epochs: 25
print_step: 50
optim:
type: Adam
lr: !!float 5e-5
lr_scheduler:
type: StepLR
step_size: 5
gamma: 0.5
loss:
type: CrossEntropyLoss
ignore_index: 255
metric:
type: IoUMetric
num_class: 21

mutate1:
pipe_step:
type: NasPipeStep

dataset:
ref: random1.dataset

search_space:
ref: random1.search_space

search_algorithm:
type: AdelaideMutate
codec: AdelaideCodec
max_sample: 100
pareto_front_file: "{local_base_path}/output/random1/pareto_front.csv"
random_file: "{local_base_path}/output/random1/random.csv"

trainer:
ref: random1.trainer
callbacks: AdelaideEATrainerCallback
codec: AdelaideCodec
save_model_desc: True

full1:
pipe_step:
type: FullyTrainPipeStep
models_folder: "{local_base_path}/output/mutate1/"

dataset:
ref: random1.dataset
train:
batch_size: 24

search_space:
ref: random1.search_space
custom:
sep_repeats: 2

trainer:
ref: random1.trainer
callbacks: AdelaideEATrainerCallback
codec: AdelaideCodec
model_statistics: True
pareto_front_file: "{local_base_path}/output/mutate1/pareto_front.csv"
random_file: "{local_base_path}/output/random1/random.csv"
epochs: 100
104 changes: 104 additions & 0 deletions benchmark/algs/bohb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
general:
worker:
timeout: 1000
gpus_per_job: 1

pipeline: [hpo1, fully_train, benchmark_cifar10]

hpo1:
pipe_step:
type: HpoPipeStep

dataset:
type: Cifar10
common:
data_path: /cache/datasets/cifar10/
test:
batch_size: 256
hpo:
type: BohbHpo
policy:
total_epochs: 81
config_count: 242
repeat_times: 2
pareto:
object_count: 2
max_object_ids: [0,1]
hyperparameter_space:
hyperparameters:
- key: dataset.batch_size
type: INT_CAT
range: [64, 128, 256]
- key: trainer.optim.lr
type: FLOAT_CAT
range: [0.001, 0.003, 0.007, 0.01, 0.03, 0.07, 0.1]
- key: trainer.optim.type
type: STRING
range: ['Adam', 'SGD']
- key: trainer.optim.momentum
type: FLOAT
range: [0.8, 0.99]
condition:
- key: condition_for_sgd_momentum
child: trainer.optim.momentum
parent: trainer.optim.type
type: EQUAL
range: ["SGD"]

model:
model_desc:
modules: ["backbone", "head"]
backbone:
base_channel: 64
downsample: [0, 0, 1, 0, 1, 0, 1, 0]
base_depth: 18
doublechannel: [0, 0, 1, 0, 1, 0, 1, 0]
name: ResNetVariant
head:
num_classes: 10
name: LinearClassificationHead
base_channel: 512

trainer:
type: Trainer
epochs: 1
optim:
type: Adam
lr: 0.1
lr_scheduler:
type: MultiStepLR
milestones: [75, 150]
gamma: 0.5
metric:
type: accuracy
loss:
type: CrossEntropyLoss

evaluator:
type: Evaluator
gpu_evaluator:
type: GpuEvaluator

fully_train:
pipe_step:
type: FullyTrainPipeStep
dataset:
ref: hpo1.dataset
model:
ref: hpo1.model
trainer:
ref: hpo1.trainer
load_checkpoint: True
epochs: 200
hps_file: "{local_base_path}/output/hpo1/best_hps.json"

benchmark_cifar10:
pipe_step:
type: BenchmarkPipeStep
models_folder: "{local_base_path}/output/fully_train/"
dataset:
type: Cifar10
evaluator:
type: Evaluator
gpu_evaluator:
type: GpuEvaluator
104 changes: 104 additions & 0 deletions benchmark/algs/boss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
general:
worker:
timeout: 1000
gpus_per_job: 1

pipeline: [hpo1, fully_train, benchmark_cifar10]

hpo1:
pipe_step:
type: HpoPipeStep

dataset:
type: Cifar10
common:
data_path: /cache/datasets/cifar10/
test:
batch_size: 256
hpo:
type: BossHpo
policy:
total_epochs: 81
config_count: 242
repeat_times: 2
pareto:
object_count: 2
max_object_ids: [0,1]
hyperparameter_space:
hyperparameters:
- key: dataset.batch_size
type: INT_CAT
range: [64, 128, 256]
- key: trainer.optim.lr
type: FLOAT_CAT
range: [0.001, 0.003, 0.007, 0.01, 0.03, 0.07, 0.1]
- key: trainer.optim.type
type: STRING
range: ['Adam', 'SGD']
- key: trainer.optim.momentum
type: FLOAT
range: [0.8, 0.99]
condition:
- key: condition_for_sgd_momentum
child: trainer.optim.momentum
parent: trainer.optim.type
type: EQUAL
range: ["SGD"]

model:
model_desc:
modules: ["backbone", "head"]
backbone:
base_channel: 64
downsample: [0, 0, 1, 0, 1, 0, 1, 0]
base_depth: 18
doublechannel: [0, 0, 1, 0, 1, 0, 1, 0]
name: ResNetVariant
head:
num_classes: 10
name: LinearClassificationHead
base_channel: 512

trainer:
type: Trainer
epochs: 1
optim:
type: Adam
lr: 0.1
lr_scheduler:
type: MultiStepLR
milestones: [75, 150]
gamma: 0.5
metric:
type: accuracy
loss:
type: CrossEntropyLoss

evaluator:
type: Evaluator
gpu_evaluator:
type: GpuEvaluator

fully_train:
pipe_step:
type: FullyTrainPipeStep
dataset:
ref: hpo1.dataset
model:
ref: hpo1.model
trainer:
ref: hpo1.trainer
load_checkpoint: True
epochs: 200
hps_file: "{local_base_path}/output/hpo1/best_hps.json"

benchmark_cifar10:
pipe_step:
type: BenchmarkPipeStep
models_folder: "{local_base_path}/output/fully_train/"
dataset:
type: Cifar10
evaluator:
type: Evaluator
gpu_evaluator:
type: GpuEvaluator
Loading

0 comments on commit 1d88e74

Please sign in to comment.