parent
5bd1dd4e89
commit
535853c205
@ -0,0 +1,22 @@
|
|||||||
|
# Copyright 2020 Huawei Technologies Co., Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
# ============================================================================
|
||||||
|
"""hub config."""
|
||||||
|
from src.yolo import YOLOV3DarkNet53
|
||||||
|
|
||||||
|
def create_network(name, *args, **kwargs):
|
||||||
|
if name == "yolov3_darknet53":
|
||||||
|
yolov3_darknet53_net = YOLOV3DarkNet53(is_training=False)
|
||||||
|
return yolov3_darknet53_net
|
||||||
|
raise NotImplementedError(f"{name} is not implemented in the repo")
|
@ -0,0 +1,32 @@
|
|||||||
|
# Copyright 2020 Huawei Technologies Co., Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
# ============================================================================
|
||||||
|
"""hub config."""
|
||||||
|
from mindspore.train.quant import quant
|
||||||
|
from src.yolo import YOLOV3DarkNet53
|
||||||
|
from src.config import ConfigYOLOV3DarkNet53
|
||||||
|
|
||||||
|
|
||||||
|
def create_network(name, *args, **kwargs):
|
||||||
|
if name == "yolov3_darknet53_quant":
|
||||||
|
yolov3_darknet53_quant = YOLOV3DarkNet53(is_training=False)
|
||||||
|
config = ConfigYOLOV3DarkNet53()
|
||||||
|
# convert fusion network to quantization aware network
|
||||||
|
if config.quantization_aware:
|
||||||
|
yolov3_darknet53_quant = quant.convert_quant_network(yolov3_darknet53_quant,
|
||||||
|
bn_fold=True,
|
||||||
|
per_channel=[True, False],
|
||||||
|
symmetric=[True, False])
|
||||||
|
return yolov3_darknet53_quant
|
||||||
|
raise NotImplementedError(f"{name} is not implemented in the repo")
|
@ -0,0 +1,23 @@
|
|||||||
|
# Copyright 2020 Huawei Technologies Co., Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
# ============================================================================
|
||||||
|
"""hub config."""
|
||||||
|
from src.yolov3 import yolov3_resnet18
|
||||||
|
from src.config import ConfigYOLOV3ResNet18
|
||||||
|
|
||||||
|
def create_network(name, *args, **kwargs):
|
||||||
|
if name == "yolov3_resnet18":
|
||||||
|
yolov3_resnet18_net = yolov3_resnet18(ConfigYOLOV3ResNet18())
|
||||||
|
return yolov3_resnet18_net
|
||||||
|
raise NotImplementedError(f"{name} is not implemented in the repo")
|
@ -0,0 +1,26 @@
|
|||||||
|
# Copyright 2020 Huawei Technologies Co., Ltd
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
# ============================================================================
|
||||||
|
"""hub config."""
|
||||||
|
from src.deepfm import ModelBuilder
|
||||||
|
from src.config import ModelConfig, TrainConfig
|
||||||
|
|
||||||
|
def create_network(name, *args, **kwargs):
|
||||||
|
if name == 'deepfm':
|
||||||
|
model_config = ModelConfig()
|
||||||
|
train_config = TrainConfig()
|
||||||
|
model_builder = ModelBuilder(model_config, train_config)
|
||||||
|
_, deepfm_eval_net = model_builder.get_train_eval_net()
|
||||||
|
return deepfm_eval_net
|
||||||
|
raise NotImplementedError(f"{name} is not implemented in the repo")
|
Loading…
Reference in new issue