Home
last modified time | relevance | path

Searched refs:momentum (Results 1 – 25 of 287) sorted by relevance

12345678910>>...12

/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/
Dmomentum_impl.cu20 … const G *gradient, const S *momentum, bool use_nesterov) { in MomentumUpdateVariableKernel() argument
23 accumulation[i] = momentum[0] * accumulation[i] + gradient[i]; in MomentumUpdateVariableKernel()
24 … variable[i] -= gradient[i] * learning_rate[0] + accumulation[i] * momentum[0] * learning_rate[0]; in MomentumUpdateVariableKernel()
28 accumulation[i] = momentum[0] * accumulation[i] + gradient[i]; in MomentumUpdateVariableKernel()
35 … const float *learning_rate, const half *gradient, const float *momentum, in MomentumUpdateVariableKernel() argument
39 accumulation[i] = __float2half(momentum[0]) * accumulation[i] + gradient[i]; in MomentumUpdateVariableKernel()
41 accumulation[i] * __float2half(momentum[0]) * __float2half(learning_rate[0]); in MomentumUpdateVariableKernel()
45 accumulation[i] = __float2half(momentum[0]) * accumulation[i] + gradient[i]; in MomentumUpdateVariableKernel()
52 … const float *learning_rate, const half *gradient, const float *momentum, in MomentumUpdateVariableKernel() argument
56 accumulation[i] = momentum[0] * accumulation[i] + __half2float(gradient[i]); in MomentumUpdateVariableKernel()
[all …]
Drmsprop_impl.cu22 __global__ void RmsPropKernel(const T* learning_rate, const T decay, const T momentum, const T epsi… in RmsPropKernel() argument
26 …moment[i] = momentum * moment[i] + learning_rate[0] * rsqrt(mean_square[i] + epsilon) * gradients[… in RmsPropKernel()
32 void RmsProp(const T* learning_rate, const T decay, const T momentum, const T epsilon, in RmsProp() argument
34 …RmsPropKernel<<<GET_BLOCKS(size), GET_THREADS, 0, cuda_stream>>>(learning_rate, decay, momentum, e… in RmsProp()
39 __global__ void RmsPropCenterKernel(const T* learning_rate, const T* decay, const T* momentum, cons… in RmsPropCenterKernel() argument
45 moment[i] = momentum[0] * moment[i] + learning_rate[0] * in RmsPropCenterKernel()
52 void RmsPropCenter(const T* learning_rate, const T* decay, const T* momentum, const T* epsilon, T* … in RmsPropCenter() argument
55 …rKernel<<<GET_BLOCKS(size), GET_THREADS, 0, cuda_stream>>>(learning_rate, decay, momentum, epsilon, in RmsPropCenter()
61 void RmsProp(const float* learning_rate, const float decay, const float momentum, const float epsil…
66 void RmsPropCenter(const float* learning_rate, const float* decay, const float* momentum, const flo…
Dsgd_impl.cu22 const T *momentum, const T *lr, T *param, T *accum, T *stat) { in SGDKernel() argument
29 if (momentum[0] > static_cast<T>(0)) { in SGDKernel()
34 accum[i] = accum[i] * momentum[0] + (1.0 - dampening) * grad_new; in SGDKernel()
38 grad_new += accum[i] * momentum[0]; in SGDKernel()
49 …size, const T dampening, const T weight_decay, const bool nesterov, const T *lr, const T *momentum, in SGD() argument
51 …OCKS(size), GET_THREADS, 0, cuda_stream>>>(size, dampening, weight_decay, nesterov, grad, momentum, in SGD()
56 const float *momentum, const float *grad, float *param, float *accum, float *stat,
Dmomentum_impl.cuh23 const S *momentum, bool use_nesterov, cudaStream_t cuda_stream);
26 const T *learning_rate, const S *gradient, const T *momentum,
30 … const T *learning_rate, const S *gradient, const T *momentum, cudaStream_t cuda_stream);
33 const S *gradient, const T *momentum, cudaStream_t cuda_stream);
37 T **momentum, cudaStream_t cuda_stream);
40 T **accumulation, T **learning_rate, S **gradient, T **momentum,
Dsync_batch_norm_impl.cu113 … G *running_var_input, float epsilon, float momentum, size_t group_rank, in SyncBatchNormGather() argument
133 …HalfFloatOutputAssign(((1 - momentum) * HalfFloatInputConvert(running_mean_input[C_ix]) + momentum in SyncBatchNormGather()
139 …HalfFloatOutputAssign(((1 - momentum) * HalfFloatInputConvert(running_var_input[C_ix]) + momentum in SyncBatchNormGather()
182 float epsilon, float momentum, size_t group_rank, size_t group_size, in CalSyncBatchNormGather() argument
186 …n_output, running_var_output, running_mean_input, running_var_input, epsilon, momentum, group_rank, in CalSyncBatchNormGather()
212 … float *running_var_input, float epsilon, float momentum,
218 … half *running_var_input, float epsilon, float momentum,
224 … float *running_var_input, float epsilon, float momentum,
230 … half *running_var_input, float epsilon, float momentum,
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/sponge/common/
Dmdtemperature_impl.cu23 VECTOR momentum = {0., 0., 0.}; in MDTemperatureKernel() local
31 momentum.x = momentum.x + mass_lin * atom_vel[atom_i].x; in MDTemperatureKernel()
32 momentum.y = momentum.y + mass_lin * atom_vel[atom_i].y; in MDTemperatureKernel()
33 momentum.z = momentum.z + mass_lin * atom_vel[atom_i].z; in MDTemperatureKernel()
36 …ek[residue_i] = 0.5 * (momentum.x * momentum.x + momentum.y * momentum.y + momentum.z * momentum.z… in MDTemperatureKernel()
/third_party/mindspore/mindspore/nn/optim/
Dsgd.py28 def _tensor_run_opt_ext(opt, momentum, learning_rate, gradient, weight, accum, stat): argument
31 success = F.depend(success, opt(weight, gradient, learning_rate, accum, momentum, stat))
139 …def __init__(self, params, learning_rate=0.1, momentum=0.0, dampening=0.0, weight_decay=0.0, neste… argument
144 if isinstance(momentum, int):
145 momentum = float(momentum)
146 if not isinstance(momentum, float):
149 if isinstance(momentum, float) and momentum < 0.0:
150 … raise ValueError("momentum should be at least 0.0, but got momentum {}".format(momentum))
166 if nesterov and (momentum <= 0.0 or dampening != 0.0):
168 "but got momentum {}, dampening {}".format(momentum, dampening))
[all …]
Dmomentum.py28 def _tensor_run_opt_ext(opt, momentum, learning_rate, gradient, weight, moment, ps_parameter, cache… argument
34 shapes = (op_shape(learning_rate), op_shape(gradient), op_shape(momentum))
35 … success = F.depend(True, _ps_pull(_ps_push((learning_rate, gradient, momentum), shapes), weight))
37 success = F.depend(True, opt(weight, moment, learning_rate, gradient, momentum))
151 …def __init__(self, params, learning_rate, momentum, weight_decay=0.0, loss_scale=1.0, use_nesterov… argument
153 Validator.check_value_type("momentum", momentum, [float], self.cls_name)
154 if isinstance(momentum, float) and momentum < 0.0:
155 … raise ValueError("momentum should be at least 0.0, but got momentum {}".format(momentum))
156 self.momentum = Parameter(Tensor(momentum, mstype.float32), name="momentum")
170 success = self.hyper_map_reverse(F.partial(_momentum_opt, self.opt, self.momentum),
[all …]
Drmsprop.py26 def _rmsprop_opt_(opt, decay, epsilon, momentum, learning_rate, weight, ms, mom, grad): argument
29 success = F.depend(success, opt(weight, ms, mom, learning_rate, grad, decay, momentum, epsilon))
35 def _centered_rmsprop_opt_(opt, decay, epsilon, momentum, learning_rate, weight, mg, ms, mom, grad): argument
38 …success = F.depend(success, opt(weight, mg, ms, mom, grad, learning_rate, decay, momentum, epsilon…
181 def __init__(self, params, learning_rate=0.1, decay=0.9, momentum=0.0, epsilon=1e-10, argument
186 validator.check_value_type("momentum", momentum, [float], self.cls_name)
187 validator.check_non_negative_float(momentum, "momentum", self.cls_name)
200 self.momentum = momentum
215 self.momentum),
219 self.momentum, lr),
[all …]
/third_party/mindspore/tests/st/ops/gpu/
Dtest_rmsprop.py30 def __init__(self, lr, decay, momentum, epsilon, var, g, mg, rms, mom): argument
35 self.momentum = momentum
44 …urn self.rms_opt(self.var, self.mg, self.rms, self.mom, self.g, self.lr, self.decay, self.momentum,
49 def __init__(self, lr, decay, momentum, epsilon, var, g, mg, rms, mom): argument
53 self.momentum = momentum
63 …elf.rms_opt(self.var, self.rms, self.mom, self.lr, self.g, self.decay, self.momentum, self.epsilon)
67 learning_rate, decay, momentum, epsilon): argument
69 moment = momentum * moment + learning_rate / np.sqrt(mean_square + epsilon) * gradients
75 learning_rate, decay, momentum, epsilon): argument
78 moment = momentum * moment + learning_rate / np.sqrt(
[all …]
/third_party/mindspore/tests/st/ops/cpu/
Dtest_rmsprop.py30 def __init__(self, lr, decay, momentum, epsilon, var, g, mg, rms, mom): argument
35 self.momentum = momentum
44 …urn self.rms_opt(self.var, self.mg, self.rms, self.mom, self.g, self.lr, self.decay, self.momentum,
49 def __init__(self, lr, decay, momentum, epsilon, var, g, mg, rms, mom): argument
53 self.momentum = momentum
63 …elf.rms_opt(self.var, self.rms, self.mom, self.lr, self.g, self.decay, self.momentum, self.epsilon)
67 learning_rate, decay, momentum, epsilon): argument
69 moment = momentum * moment + learning_rate / np.sqrt(mean_square + epsilon) * gradients
75 learning_rate, decay, momentum, epsilon): argument
78 moment = momentum * moment + learning_rate / np.sqrt(
[all …]
/third_party/mindspore/mindspore/nn/layer/
Dnormalization.py50 momentum=0.9, argument
67 if momentum < 0 or momentum > 1:
132 self.momentum = 1.0 - momentum
140 momentum=self.momentum,
144 momentum=self.momentum,
239 …self.num_features, self.eps, self.momentum, self.gamma, self.beta, self.moving_mean, self.moving_v…
353 momentum=0.9, argument
363 momentum,
461 momentum=0.9, argument
472 momentum,
[all …]
/third_party/mindspore/tests/st/fl/cross_silo_faster_rcnn/src/FasterRcnn/
Dresnet.py38 def _BatchNorm2dInit(out_chls, momentum=0.1, affine=True, use_batch_statistics=True): argument
45 return nn.BatchNorm2d(out_chls, momentum=momentum, affine=affine, gamma_init=gamma_init,
193 momentum=0.1, argument
202 …self.bn1 = _BatchNorm2dInit(out_chls, momentum=momentum, affine=self.affine, use_batch_statistics=…
205 …self.bn2 = _BatchNorm2dInit(out_chls, momentum=momentum, affine=self.affine, use_batch_statistics=…
208 …self.bn3 = _BatchNorm2dInit(out_channels, momentum=momentum, affine=self.affine, use_batch_statist…
224 … self.bn_down_sample = _BatchNorm2dInit(out_channels, momentum=momentum, affine=self.affine,
Dresnet50v1.py38 def _BatchNorm2dInit(out_chls, momentum=0.1, affine=True, use_batch_statistics=True): argument
45 return nn.BatchNorm2d(out_chls, momentum=momentum, affine=affine, gamma_init=gamma_init,
193 momentum=0.1, argument
203 …self.bn1 = _BatchNorm2dInit(out_chls, momentum=momentum, affine=self.affine, use_batch_statistics=…
207 …self.bn2 = _BatchNorm2dInit(out_chls, momentum=momentum, affine=self.affine, use_batch_statistics=…
210 …self.bn3 = _BatchNorm2dInit(out_channels, momentum=momentum, affine=self.affine, use_batch_statist…
226 … self.bn_down_sample = _BatchNorm2dInit(out_channels, momentum=momentum, affine=self.affine,
/third_party/mindspore/mindspore/core/ops/grad/
Dbn_grad.cc24 void BNGrad::Init(const float eps, const float momentum) { in Init() argument
26 this->set_momentum(momentum); in Init()
37 void BNGrad::set_momentum(const float momentum) { (void)this->AddAttr(kMomentum, MakeValue(momentum in set_momentum() argument
/third_party/mindspore/mindspore/core/ops/
Dfused_batch_norm.cc24 void FusedBatchNorm::Init(const int64_t mode, const float epsilon, const float momentum) { in Init() argument
27 this->set_momentum(momentum); in Init()
34 void FusedBatchNorm::set_momentum(const float momentum) { (void)this->AddAttr(kMomentum, MakeValue( in set_momentum() argument
/third_party/boost/libs/units/example/
Dconversion_factor.cpp62 conversion_factor(cgs::momentum(),si::momentum()); in main()
66 conversion_factor(si::momentum()/si::mass(),cgs::momentum()/cgs::gram); in main()
/third_party/mindspore/tests/ut/python/parallel/
Dtest_auto_parallel_resnet_sharding_propagation2.py27 from mindspore.nn.optim.momentum import Momentum
67 def _fused_bn(channels, momentum=0.9): argument
69 return nn.BatchNorm2d(channels, momentum=momentum)
79 momentum=0.9): argument
84 self.bn1 = _fused_bn(out_chls, momentum=momentum)
87 self.bn2 = _fused_bn(out_chls, momentum=momentum)
90 self.bn3 = _fused_bn(out_channels, momentum=momentum)
98 self.bn_down_sample = _fused_bn(out_channels, momentum=momentum)
Dtest_auto_parallel_resnet_sharding_propagation.py27 from mindspore.nn.optim.momentum import Momentum
68 def _fused_bn(channels, momentum=0.9): argument
70 return nn.BatchNorm2d(channels, momentum=momentum)
80 momentum=0.9): argument
85 self.bn1 = _fused_bn(out_chls, momentum=momentum)
88 self.bn2 = _fused_bn(out_chls, momentum=momentum)
91 self.bn3 = _fused_bn(out_channels, momentum=momentum)
99 self.bn_down_sample = _fused_bn(out_channels, momentum=momentum)
Dtest_full_batch.py24 from mindspore.nn.optim.momentum import Momentum
69 momentum = 0.9
84 opt = Momentum(net.trainable_params(), learning_rate, momentum)
97 momentum = 0.9
107 opt = Momentum(net.trainable_params(), learning_rate, momentum)
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/
Dsgd_cpu_kernel.cc45 auto momentum = reinterpret_cast<T *>(inputs[MOMENTUM]->addr); in Launch() local
50 …auto task = [this, &param, &grad, &lr, &accum, &momentum, &stat, &output_param](size_t start, size… in Launch()
58 if (momentum[0] > ZERO) { in Launch()
63 accum[i] = accum[i] * momentum[0] + (ONE - static_cast<T>(dampening_)) * grad_new; in Launch()
66 grad_new += accum[i] * momentum[0]; in Launch()
/third_party/mindspore/mindspore/ccsrc/backend/optimizer/gpu/
Dcombine_momentum_fusion.cc26 std::vector<AnfNodePtr> momentum; in GetDealList() local
31 momentum.push_back(momentum_node); in GetDealList()
37 if (momentum.size() <= 1 && momentum_decay.size() <= 1) { in GetDealList()
40 if (momentum.size() > 1) { in GetDealList()
41 deal_list->push_back(momentum); in GetDealList()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp32/
Dbatchnorm_fp32.c67 const float momentum = (1.0f - param->momentum_); in FusedBatchNormFp32MeanVar() local
87 save_mean[c] = momentum * save_mean[c] + (1.0f - momentum) * run_mean[c]; in FusedBatchNormFp32MeanVar()
88 save_var[c] = momentum * save_var[c] + (1.0f - momentum) * unbiased_var; in FusedBatchNormFp32MeanVar()
Drmsprop_fp32.c31 …useCenterFp32(float *variable, float *mean_square, float *moment, float *gradients, float momentum, in RMSPropUnuseCenterFp32() argument
42 __m256 momentum_r = _mm256_set1_ps(momentum); in RMSPropUnuseCenterFp32()
74 …moment[c1] = moment[c1] * momentum + (gradients[c1] * learning_rate) / sqrt(mean_square[c1] + epsi… in RMSPropUnuseCenterFp32()
81 … float momentum, float learning_rate, float decay, float epsilon, size_t start, size_t end) { in RMSPropUseCenterFp32() argument
92 __m256 momentum_r = _mm256_set1_ps(momentum); in RMSPropUseCenterFp32()
141 moment[c1] = moment[c1] * momentum + (gradients[c1] * learning_rate) / sqrt(denom); in RMSPropUseCenterFp32()
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/cpu/nnacl/fp16/
Dbatchnorm_fp16.c66 const float momentum = (1.0f - param->momentum_); in FusedBatchNormFp16MeanVar() local
86 …save_mean[c] = (float16_t)(momentum * (float)save_mean[c] + (1.0f - momentum) * (float)run_mean[c]… in FusedBatchNormFp16MeanVar()
87 save_var[c] = (float16_t)(momentum * (float)save_var[c] + (1.0f - momentum) * unbiased_var); in FusedBatchNormFp16MeanVar()

12345678910>>...12