prompt
stringlengths
94
42.6k
completion
stringlengths
6
120
api
stringlengths
14
68
import platform import numpy as np import pytest import megengine as mge import megengine.distributed as dist from megengine.distributed.helper import get_device_count_by_fork from megengine.quantization.observer import ( ExponentialMovingAverageObserver, MinMaxObserver, Observer, PassiveObserver, ...
get_device_count_by_fork("gpu")
megengine.distributed.helper.get_device_count_by_fork
import platform import numpy as np import pytest import megengine as mge import megengine.distributed as dist from megengine.distributed.helper import get_device_count_by_fork from megengine.quantization.observer import ( ExponentialMovingAverageObserver, MinMaxObserver, Observer, PassiveObserver, ...
dist.get_rank()
megengine.distributed.get_rank
import platform import numpy as np import pytest import megengine as mge import megengine.distributed as dist from megengine.distributed.helper import get_device_count_by_fork from megengine.quantization.observer import ( ExponentialMovingAverageObserver, MinMaxObserver, Observer, PassiveObserver, ...
SyncExponentialMovingAverageObserver(momentum=t)
megengine.quantization.observer.SyncExponentialMovingAverageObserver
import platform import numpy as np import pytest import megengine as mge import megengine.distributed as dist from megengine.distributed.helper import get_device_count_by_fork from megengine.quantization.observer import ( ExponentialMovingAverageObserver, MinMaxObserver, Observer, PassiveObserver, ...
get_device_count_by_fork("gpu")
megengine.distributed.helper.get_device_count_by_fork
import platform import numpy as np import pytest import megengine as mge import megengine.distributed as dist from megengine.distributed.helper import get_device_count_by_fork from megengine.quantization.observer import ( ExponentialMovingAverageObserver, MinMaxObserver, Observer, PassiveObserver, ...
mge.tensor(2.0)
megengine.tensor
import random from megengine.data.transform import RandomResizedCrop as mge_RRC from megengine.data.transform import Resize as mge_resize from ..registry import PIPELINES from edit.utils import interp_codes @PIPELINES.register_module() class Resize(object): """ Args: size (int|list|tuple): Desired ...
mge_resize(output_size=self.size, interpolation=interp_codes[interpolation])
megengine.data.transform.Resize
import random from megengine.data.transform import RandomResizedCrop as mge_RRC from megengine.data.transform import Resize as mge_resize from ..registry import PIPELINES from edit.utils import interp_codes @PIPELINES.register_module() class Resize(object): """ Args: size (int|list|tuple): Desired ...
mge_RRC(output_size=output_size, scale_range=scale, ratio_range=ratio, interpolation=interp_codes[interpolation])
megengine.data.transform.RandomResizedCrop
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import bisect import datetime import math import os import pickle import time from typing import Optional import megengine as mge import megengine.distributed as dist import megengine.module as M from basecore.config import ConfigDict fr...
dist.get_world_size()
megengine.distributed.get_world_size
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import bisect import datetime import math import os import pickle import time from typing import Optional import megengine as mge import megengine.distributed as dist import megengine.module as M from basecore.config import ConfigDict fr...
dist.get_rank()
megengine.distributed.get_rank
#!/usr/bin/env python3 # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. import bisect import datetime import math import os import pickle import time from typing import Optional import megengine as mge import megengine.distributed as dist import megengine.module as M from basecore.config import ConfigDict fr...
dist.get_rank()
megengine.distributed.get_rank
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.stack([broad_shift_x, broad_shift_y, broad_shift_x, broad_shift_y], axis=1)
megengine.functional.stack
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.concat([rpn_bbox, rpn_cls_scores, rpn_iou_prob], axis=1)
megengine.functional.concat
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.concat(res, 0)
megengine.functional.concat
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(labels, axis=2)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Sequential(*cls_subnet)
megengine.module.Sequential
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Sequential(*bbox_subnet)
megengine.module.Sequential
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.fill_(self.cls_score.bias, bias_value)
megengine.module.init.fill_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Conv2d(fpn_dim, fpn_dim, kernel_size=3, stride=2, padding=1, bias=use_bias)
megengine.module.Conv2d
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Conv2d(fpn_dim, fpn_dim, kernel_size=3, stride=2, padding=1, bias=use_bias)
megengine.module.Conv2d
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.ReLU()
megengine.module.ReLU
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(anchors, axis=0)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(shifts, axis=1)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.concat(rpn_cls_list, axis=1)
megengine.functional.concat
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.concat(rpn_bbox_list,axis=1)
megengine.functional.concat
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.concat(rpn_iou_list, axis=1)
megengine.functional.concat
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(ignore_mask, axis=0)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.nn.indexing_one_hot(overlaps, index, 1)
megengine.functional.nn.indexing_one_hot
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.sigmoid(cls_score)
megengine.functional.sigmoid
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.msra_normal_(lateral_conv.weight, mode="fan_in")
megengine.module.init.msra_normal_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.msra_normal_(output_conv.weight, mode="fan_in")
megengine.module.init.msra_normal_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
mge.tensor(np_anchors)
megengine.tensor
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
mge.tensor(mean)
megengine.tensor
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
mge.tensor(std)
megengine.tensor
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(value, axis=1)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1)
megengine.module.Conv2d
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.ReLU()
megengine.module.ReLU
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.Conv2d(in_channels, in_channels, kernel_size=3, stride=1, padding=1)
megengine.module.Conv2d
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.ReLU()
megengine.module.ReLU
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.fill_(lateral_conv.bias, 0)
megengine.module.init.fill_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.fill_(output_conv.bias, 0)
megengine.module.init.fill_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.linspace(0, width-1, width)
megengine.functional.linspace
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.linspace(0, height -1, height)
megengine.functional.linspace
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(all_anchors, 1)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.normal_(layer.weight, std=0.01)
megengine.module.init.normal_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
M.init.fill_(layer.bias, 0)
megengine.module.init.fill_
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.expand_dims(all_anchors, 1)
megengine.functional.expand_dims
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.equal(gtboxes[:, 4], config.anchor_ignore_label)
megengine.functional.equal
import numpy as np import megengine as mge import megengine.functional as F import megengine.module as M import math from config import config from backbone.resnet50 import ResNet50 from module.generate_anchors import generate_anchors from det_opr.bbox_opr import bbox_transform_inv_opr, box_overlap_opr from det_opr.uti...
F.ones([a.shape[0], 1])
megengine.functional.ones
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.zeros((2*B, netG.hidden_channels, h, w))
megengine.functional.zeros
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.zeros((2*B, netG.hidden_channels, h, w))
megengine.functional.zeros
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
dist.is_distributed()
megengine.distributed.is_distributed
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.concat([image[:, i, ...], image[:, T-i-1, ...]], axis=0)
megengine.functional.concat
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
mge.tensor(batchdata['lq'], dtype="float32")
megengine.tensor
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
mge.tensor(batchdata['gt'], dtype="float32")
megengine.tensor
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.nn.interpolate(image, scale_factor=4)
megengine.functional.nn.interpolate
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.concat([image[:, i, ...], image[:, T-i-1, ...]], axis=0)
megengine.functional.concat
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.concat([image[:, i-1, ...], image[:, T-i, ...]], axis=0)
megengine.functional.concat
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.concat([image[:, i-1, ...], image[:, T-i, ...]], axis=0)
megengine.functional.concat
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
dist.functional.all_reduce_sum(loss)
megengine.distributed.functional.all_reduce_sum
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
dist.get_world_size()
megengine.distributed.get_world_size
import os import time import numpy as np import megengine.distributed as dist import megengine as mge import megengine.functional as F from megengine.autodiff import GradManager from edit.core.hook.evaluation import psnr, ssim from edit.utils import imwrite, tensor2img, bgr2ycbcr, img_multi_padding, img_de_multi_paddin...
F.expand_dims(inp, axis=0)
megengine.functional.expand_dims
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.mean(x, [2, 3], True)
megengine.functional.mean
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.nn.interpolate(gp, (x.shape[2], x.shape[3]))
megengine.functional.nn.interpolate
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.concat([conv1, conv31, conv32, conv33, gp], axis=1)
megengine.functional.concat
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Dropout(0.5)
megengine.module.Dropout
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(256, self.num_classes, 1, 1, padding=0)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.nn.interpolate(up0, scale_factor=self.sub_output_stride)
megengine.functional.nn.interpolate
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.concat([up0, up1], 1)
megengine.functional.concat
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
F.nn.interpolate(out, scale_factor=4)
megengine.functional.nn.interpolate
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(in_channels, out_channels, 1, 1, 0, bias=False)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(out_channels * 5, out_channels, 1, 1, padding=0, bias=False)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(out_channels)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(256, 48, 1, 1, padding=1 // 2, bias=False)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(48)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(256 + 48, 256, 3, 1, padding=1, bias=False)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(256)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Dropout(0.5)
megengine.module.Dropout
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Conv2d(256, 256, 3, 1, padding=1, bias=False)
megengine.module.Conv2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.BatchNorm2d(256)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.ReLU()
megengine.module.ReLU
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.Dropout(0.1)
megengine.module.Dropout
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.init.msra_normal_(m.weight, mode="fan_out", nonlinearity="relu")
megengine.module.init.msra_normal_
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.init.ones_(m.weight)
megengine.module.init.ones_
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
M.init.zeros_(m.bias)
megengine.module.init.zeros_
import math import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def restore_bbox(rois, deltas, unnormalize=True, config = None): assert deltas.ndim == 3 if unnormalize: std_opr = mge.tensor(config.bbox_normalize_stds.reshape(1, 1, -1)) ...
F.minimum(dw, max_delta)
megengine.functional.minimum
import math import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def restore_bbox(rois, deltas, unnormalize=True, config = None): assert deltas.ndim == 3 if unnormalize: std_opr = mge.tensor(config.bbox_normalize_stds.reshape(1, 1, -1)) ...
F.minimum(dh, max_delta)
megengine.functional.minimum
import math import megengine as mge import megengine.functional as F import numpy as np from megengine import Tensor import pdb def restore_bbox(rois, deltas, unnormalize=True, config = None): assert deltas.ndim == 3 if unnormalize: std_opr = mge.tensor(config.bbox_normalize_stds.reshape(1, 1, -1)) ...
F.log(gt_width / bbox_width)
megengine.functional.log