prompt
stringlengths
94
42.6k
completion
stringlengths
6
120
api
stringlengths
14
68
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
Tensor(data)
megengine.tensor.Tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
Tensor(label)
megengine.tensor.Tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
BatchNorm2d(20)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
BatchNorm2d(20)
megengine.module.BatchNorm2d
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
ad.GradManager()
megengine.autodiff.GradManager
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.make_allreduce_cb("MEAN", dist.WORLD)
megengine.distributed.make_allreduce_cb
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
ad.GradManager()
megengine.autodiff.GradManager
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.make_allreduce_cb("MEAN", dist.WORLD)
megengine.distributed.make_allreduce_cb
# -*- 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...
mgb.load_comp_graph_from_file(fpath)
megengine._internal.load_comp_graph_from_file
# -*- 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...
mgb.cgtools.get_dep_vars(outputs, "Host2DeviceCopy")
megengine._internal.cgtools.get_dep_vars
# -*- 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...
jit.trace(symbolic=False)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True, opt_level=0)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True, opt_level=1)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True, profiling=True)
megengine.jit.trace
# -*- 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...
tensor(7)
megengine.tensor
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
tensor(7)
megengine.tensor
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
jit.trace(symbolic=True)
megengine.jit.trace
# -*- 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...
mgb.cgtools.get_inputs(out)
megengine._internal.cgtools.get_inputs
# -*- 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...
SublinearMemoryConfig(genetic_nr_iter=10)
megengine.jit.SublinearMemoryConfig
# -*- 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...
jit.trace(symbolic=True, sublinear_memory_config=config)
megengine.jit.trace
# -*- 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...
mgb.load_comp_graph_from_file(out)
megengine._internal.load_comp_graph_from_file
# -*- 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...
jit.trace(symbolic=symbolic)
megengine.jit.trace
# -*- 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...
mgb.load_comp_graph_from_file(out)
megengine._internal.load_comp_graph_from_file
# -*- 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...
mgb.opr.assert_equal(x._symvar, x._symvar + 1)
megengine._internal.opr.assert_equal
# -*- 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...
mgb.opr.assert_equal(x._symvar, x._symvar + 1)
megengine._internal.opr.assert_equal
# -*- 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...
mgb.cgtools.get_inputs(out)
megengine._internal.cgtools.get_inputs
# -*- 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(3, 4, 3, 1, 1, groups=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(4)
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...
mgb.cgtools.get_type(inputs[0])
megengine._internal.cgtools.get_type
# -*- 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...
mgb.cgtools.get_type(inputs[1])
megengine._internal.cgtools.get_type
# -*- 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...
megengine.logger.get_logger()
megengine.logger.get_logger
# -*- 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...
data.dataset.ImageNet(args.data, train=False)
megengine.data.dataset.ImageNet
# -*- 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...
dist.Server(port=args.dist_port)
megengine.distributed.Server
# -*- 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...
megengine.load(args.model)
megengine.load
# -*- 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.cross_entropy(logits, label)
megengine.functional.nn.cross_entropy
# -*- 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.topk_accuracy(logits, label, topk=(1, 5))
megengine.functional.topk_accuracy
# -*- 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...
megengine.tensor(image, dtype="float32")
megengine.tensor
# -*- 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...
megengine.tensor(label, dtype="int32")
megengine.tensor
# -*- 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- 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...
dist.get_world_size()
megengine.distributed.get_world_size
# -*- 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.distributed.all_reduce_sum(loss)
megengine.functional.distributed.all_reduce_sum
# -*- 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.distributed.all_reduce_sum(acc1)
megengine.functional.distributed.all_reduce_sum
# -*- 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.distributed.all_reduce_sum(acc5)
megengine.functional.distributed.all_reduce_sum
# -*- 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- 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...
T.Resize(256)
megengine.data.transform.Resize
# -*- 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...
T.CenterCrop(224)
megengine.data.transform.CenterCrop
# -*- 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...
T.ToMode("CHW")
megengine.data.transform.ToMode
import math import numpy import megengine as mge import megengine.module as M import megengine.functional as F from .layer_norm import LayerNorm class DecoderLayer(M.Module): """Single decoder layer module.""" def __init__( self, size, self_attn, src_attn, feed_forwar...
M.dropout.Dropout(dropout_rate)
megengine.module.dropout.Dropout
import math import numpy import megengine as mge import megengine.module as M import megengine.functional as F from .layer_norm import LayerNorm class DecoderLayer(M.Module): """Single decoder layer module.""" def __init__( self, size, self_attn, src_attn, feed_forwar...
F.concat([cache, x], axis=1)
megengine.functional.concat
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import argparse from loguru import logger import multiprocessing as mp import megengine as mge import megengine.distributed as dist from yolox.core import Trainer from yolox.exp import get_exp from yolox.utils import confi...
mge.dtr.enable()
megengine.dtr.enable
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import argparse from loguru import logger import multiprocessing as mp import megengine as mge import megengine.distributed as dist from yolox.core import Trainer from yolox.exp import get_exp from yolox.utils import confi...
dist.helper.get_device_count_by_fork("gpu")
megengine.distributed.helper.get_device_count_by_fork
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import argparse from loguru import logger import multiprocessing as mp import megengine as mge import megengine.distributed as dist from yolox.core import Trainer from yolox.exp import get_exp from yolox.utils import confi...
config_async_level(args.sync_level)
megengine.core._imperative_rt.core2.config_async_level
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import argparse from loguru import logger import multiprocessing as mp import megengine as mge import megengine.distributed as dist from yolox.core import Trainer from yolox.exp import get_exp from yolox.utils import confi...
dist.launcher(main, n_gpus=args.devices)
megengine.distributed.launcher
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean((r_gt_euler_deg - r_pred_euler_deg)**2, axis=1)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean((t_gt - t_pred)**2, axis=1)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(r_mse)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(t_mse)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(r_mae)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(t_mae)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.norm(concatenated[:, :, 3], axis=-1)
megengine.functional.norm
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(residual_rotdeg)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.mean(residual_transmag)
megengine.functional.mean
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.abs(r_gt_euler_deg - r_pred_euler_deg)
megengine.functional.abs
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.abs(t_gt - t_pred)
megengine.functional.abs
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.concat(total_losses)
megengine.functional.concat
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.l1_loss(pose_pair[0][:, :4], pose_pair[1][:, :4])
megengine.functional.nn.l1_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(pose_pair[0][:, 4:], pose_pair[1][:, 4:])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_t_feats[0], all_t_feats[1])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_R_feats[0], all_R_feats[1])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_R_feats[0], all_R_feats[2])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_t_feats[0], all_t_feats[2])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_dropout_R_feats[0], all_dropout_R_feats[1])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_dropout_R_feats[2], all_dropout_R_feats[3])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_dropout_t_feats[0], all_dropout_t_feats[1])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.nn.square_loss(all_dropout_t_feats[2], all_dropout_t_feats[3])
megengine.functional.nn.square_loss
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.clip(0.5 * (rot_trace - 1), -1.0, 1.0)
megengine.functional.clip
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.clip(-R_feats_neg + params.margin[i], lower=0.0)
megengine.functional.clip
import numpy as np import megengine.functional as F from common import se3, so3 def compute_losses(endpoints, params): loss = {} # compute losses if params.loss_type == "finet": num_iter = len(endpoints["all_pose_pair"]) triplet_loss = {} for i in range(num_iter): # reg...
F.clip(-t_feats_neg + params.margin[i], lower=0.0)
megengine.functional.clip
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.launcher(n_gpus=2)
megengine.distributed.launcher
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.launcher(n_gpus=2)
megengine.distributed.launcher
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.launcher(n_gpus=2)
megengine.distributed.launcher
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.launcher(n_gpus=2)
megengine.distributed.launcher
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
tensor(data[rank])
megengine.tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
tensor(data[rank])
megengine.tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
tensor(data[rank])
megengine.tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
dist.get_rank()
megengine.distributed.get_rank
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
tensor(data[rank])
megengine.tensor
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
all_gather(inp, axis=axis)
megengine.distributed.functional.all_gather
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
trace(symbolic=symbolic)
megengine.jit.trace
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 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...
reduce_scatter_sum(inp, axis=axis)
megengine.distributed.functional.reduce_scatter_sum