| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.centerface import CenterfaceMobilev2 | |||||
| def centerface(*args, **kwargs): | |||||
| return CenterfaceMobilev2(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "centerface": | |||||
| return CenterfaceMobilev2(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.cnn_ctc import CNNCTC_Model | |||||
| def cnnctc(*args, **kwargs): | |||||
| return CNNCTC_Model(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "cnnctc": | |||||
| return CNNCTC_Model(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.efficientnet import efficientnet_b0 | |||||
| def efficinetnet(*args, **kwargs): | |||||
| return efficientnet_b0(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "efficinetnet": | |||||
| return efficientnet_b0(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.inceptionv4 import Inceptionv4 | |||||
| def inceptionv4_net(*args, **kwargs): | |||||
| return Inceptionv4(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "inceptionv4": | |||||
| return Inceptionv4(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.mobilenet_v1 import mobilenet_v1 | |||||
| def mobilenetv1(*args, **kwargs): | |||||
| return mobilenet_v1(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "mobilenetv1": | |||||
| return mobilenet_v1(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.openposenet import OpenPoseNet | |||||
| def openposenet(*args, **kwargs): | |||||
| return OpenPoseNet(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "openposenet": | |||||
| return OpenPoseNet(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.shufflenetv1 import ShuffleNetV1 | |||||
| def shufflenetv1(*args, **kwargs): | |||||
| return ShuffleNetV1(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "shufflenetv1": | |||||
| return ShuffleNetV1(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.shufflenetv2 import ShuffleNetV2 | |||||
| def shufflenetv2(*args, **kwargs): | |||||
| return ShuffleNetV2(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "shufflenetv2": | |||||
| return ShuffleNetV2(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.squeezenet import SqueezeNet | |||||
| def squeezenet(*args, **kwargs): | |||||
| return SqueezeNet(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "squeezenet": | |||||
| return SqueezeNet(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.Xception import xception | |||||
| def xceptionnet(*args, **kwargs): | |||||
| return xception(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "xception": | |||||
| return xception(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.fasttext_model import FastText | |||||
| def fasttext(*args, **kwargs): | |||||
| return FastText(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "fasttext": | |||||
| return FastText(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -1,4 +1,4 @@ | |||||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||||
| # Copyright 2020-2021 Huawei Technologies Co., Ltd | |||||
| # | # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
| @@ -24,6 +24,7 @@ from .transformer import LabelSmoothedCrossEntropyCriterion | |||||
| from .transformer import TransformerTrainOneStepWithLossScaleCell | from .transformer import TransformerTrainOneStepWithLossScaleCell | ||||
| from .transformer import TransformerTraining | from .transformer import TransformerTraining | ||||
| from .transformer import infer | from .transformer import infer | ||||
| from .transformer import TransformerInferModel | |||||
| from .language_model import LooseMaskedLanguageModel | from .language_model import LooseMaskedLanguageModel | ||||
| from .language_model import MaskedLanguageModel | from .language_model import MaskedLanguageModel | ||||
| from .language_model import NoiseChannelLanguageModel | from .language_model import NoiseChannelLanguageModel | ||||
| @@ -40,5 +41,6 @@ __all__ = [ | |||||
| "LabelSmoothedCrossEntropyCriterion", | "LabelSmoothedCrossEntropyCriterion", | ||||
| "LooseMaskedLanguageModel", | "LooseMaskedLanguageModel", | ||||
| "MaskedLanguageModel", | "MaskedLanguageModel", | ||||
| "TransformerInferModel", | |||||
| "NoiseChannelLanguageModel" | "NoiseChannelLanguageModel" | ||||
| ] | ] | ||||
| @@ -1,4 +1,4 @@ | |||||
| # Copyright 2020 Huawei Technologies Co., Ltd | |||||
| # Copyright 2020-2021 Huawei Technologies Co., Ltd | |||||
| # | # | ||||
| # Licensed under the Apache License, Version 2.0 (the "License"); | # Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| # you may not use this file except in compliance with the License. | # you may not use this file except in compliance with the License. | ||||
| @@ -20,6 +20,7 @@ from .beam_search import BeamSearchDecoder | |||||
| from .transformer_for_train import TransformerTraining, LabelSmoothedCrossEntropyCriterion, \ | from .transformer_for_train import TransformerTraining, LabelSmoothedCrossEntropyCriterion, \ | ||||
| TransformerNetworkWithLoss, TransformerTrainOneStepWithLossScaleCell | TransformerNetworkWithLoss, TransformerTrainOneStepWithLossScaleCell | ||||
| from .infer_mass import infer, infer_ppl | from .infer_mass import infer, infer_ppl | ||||
| from .transformer_for_infer import TransformerInferModel | |||||
| __all__ = [ | __all__ = [ | ||||
| "infer", | "infer", | ||||
| @@ -31,5 +32,6 @@ __all__ = [ | |||||
| "Transformer", | "Transformer", | ||||
| "TransformerEncoder", | "TransformerEncoder", | ||||
| "TransformerDecoder", | "TransformerDecoder", | ||||
| "BeamSearchDecoder" | |||||
| "BeamSearchDecoder", | |||||
| "TransformerInferModel" | |||||
| ] | ] | ||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.textcnn import TextCNN | |||||
| def textcnn_net(*args, **kwargs): | |||||
| return TextCNN(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "textcnn": | |||||
| return TextCNN(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.ncf import NCFModel | |||||
| def ncfnet(*args, **kwargs): | |||||
| return NCFModel(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "ncf": | |||||
| return NCFModel(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.musictagger import MusicTaggerCNN | |||||
| def fcn_4(*args, **kwargs): | |||||
| return MusicTaggerCNN(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "fcn4": | |||||
| return MusicTaggerCNN(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||
| @@ -0,0 +1,25 @@ | |||||
| # Copyright 2021 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.textrcnn import textrcnn | |||||
| def textrcnn_net(*args, **kwargs): | |||||
| return textrcnn(*args, **kwargs) | |||||
| def create_network(name, *args, **kwargs): | |||||
| if name == "textrcnn": | |||||
| return textrcnn(*args, **kwargs) | |||||
| raise NotImplementedError(f"{name} is not implemented in the repo") | |||||