Home
last modified time | relevance | path

Searched refs:running_mean (Results 1 – 12 of 12) sorted by relevance

/third_party/mindspore/tests/st/ops/gpu/
Dtest_batchnorm_fold2_op.py35 …def construct(self, x, beta, gamma, batch_std, batch_mean, running_std, running_mean, current_step… argument
36 … return self.op(x, beta, gamma, batch_std, batch_mean, running_std, running_mean, current_step)
47 …def construct(self, x, beta, gamma, batch_std, batch_mean, running_std, running_mean, current_step… argument
50 running_std, running_mean, current_step)
68 running_mean = np.random.uniform(1, 2, size=[c]).astype('float32')
71 Tensor(running_std), Tensor(running_mean), Tensor(current_step))
73 1) - (gamma * running_mean / running_std).reshape(-1, 1,
84 Tensor(running_mean), Tensor(current_step))
86 1) - (gamma * running_mean / running_std).reshape(-1, 1,
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/
Dbatchnorm_fold2_impl.cu29 … const T *running_std, const T *running_mean, const int *global_step, T *y, in BatchNormFold2Kernel() argument
41 y[i] = x[i] + beta[c] - gamma[c] * running_mean[c] / running_std[c]; in BatchNormFold2Kernel()
68 … const T *running_mean, const T *running_std, const T *gamma, T *d_gamma, in BatchNormFold2GradNotFreeze() argument
79 __global__ void BatchNormFold2GradFreeze(const T *d_beta, const T *running_mean, const T *running_s… in BatchNormFold2GradFreeze() argument
82 d_gamma[i] = -d_beta[i] * running_mean[i] / running_std[i]; in BatchNormFold2GradFreeze()
105 … const T *running_std, const T *running_mean, const int *global_step, T *y, int freeze_bn, in BatchNormFold2Forward() argument
109 …x, beta, gamma, batch_std, batch_mean, running_std, running_mean, global_step, y, freeze_bn, N, C,… in BatchNormFold2Forward()
114 … const float *running_mean, const int *global_step, float *y, int freeze_bn,
133 … const T *running_mean, const T *running_std, const T *gamma, T *d_gamma, in CalBatchNormFold2GradNotFreeze() argument
136 …d_beta, reduce_x, batch_mean, batch_std, running_mean, running_std, gamma, d_gamma, d_batch_mean, … in CalBatchNormFold2GradNotFreeze()
[all …]
Dbatchnorm_fold2_impl.cuh23 … const T *running_std, const T *running_mean, const int *global_step, T *y, int freeze_bn,
27 … const T *running_mean, const T *running_std, const T *gamma, T *d_gamma,
31 … const T *running_mean, const T *running_std, const T *gamma, T *d_gamma,
/third_party/mindspore/tests/vm_impl/
Dvm_me.py71 def _batch_norm(x, scale, shift, running_mean=None, running_var=None, argument
79 running_mean = np.zeros(c_h_w)
94 running_mean = momentum * running_mean + (1 - momentum) * x_mean
98 x_norm = (x - running_mean) / np.sqrt(running_var + eps)
99 x_mean = running_mean
104 return out, x_mean, x_var, running_mean, running_var
115 out, _, _, running_mean, running_var = _batch_norm(x, scale, shift, mean, variance, \
118 return out.reshape(*input_shape), np.array(scale), np.array(shift), running_mean, running_var
129 x_norm, x_mean, x_var, _, _ = _batch_norm(x, scale, shift=0, running_mean=save_mean, \
Dnn_ops_vm_impl.py106 out, x_mean, x_var, running_mean, running_var = vm.batch_norm(x, scale, b, mean, \
110 Tensor(running_mean), Tensor(running_var)
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/quant/
Dbatchnorm_fold2_grad_gpu_kernel.h58 auto *running_mean = GetDeviceAddress<T>(inputs, 6); in Launch() local
87 …CalBatchNormFold2GradNotFreeze(d_beta, reduce_x, batch_mean, batch_std, running_mean, running_std,… in Launch()
90 …CalBatchNormFold2GradFreeze(d_beta, reduce_x, batch_mean, batch_std, running_mean, running_std, ga… in Launch()
Dbatchnorm_fold2_gpu_kernel.h58 auto *running_mean = GetDeviceAddress<T>(inputs, 6); in Launch() local
62 …BatchNormFold2Forward(input, beta, gamma, batch_std, batch_mean, running_std, running_mean, global… in Launch()
Dbatchnorm_fold_gpu_kernel.h72 auto running_mean = GetDeviceAddress<T>(outputs, 2); in Launch() local
77 … cudaMemcpyAsync(running_mean, mean, output_size_, cudaMemcpyDeviceToDevice, in Launch()
/third_party/mindspore/mindspore/ops/_op_impl/_custom_op/
Dbatchnorm_fold.py91 running_mean = te.lang.cce.vadds(mean, 0.0)
93 res = [y, batch_mean, batch_std, running_mean, running_std, mean_updated, variance_updated]
101 … y, batch_mean, batch_std, running_mean, running_std, mean_updated, variance_updated, argument
/third_party/mindspore/mindspore/ops/_grad/
Dgrad_quant_ops.py118 …def bprop(x, beta, gamma, batch_std, batch_mean, running_std, running_mean, global_step, out, dout… argument
120 running_mean, global_step)
121 …x, d_beta, d_gamma, d_batch_std, d_batch_mean, zeros_like(running_std), zeros_like(running_mean), \
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/nn/
Dbatch_norm_gpu_kernel.h51 auto running_mean = GetDeviceAddress<float>(inputs, 3); in Launch() local
71 …bias, exp_avg_factor_, running_mean, running_variance, epsilon_, save_mean, save_variance, activat… in Launch()
78 scale, bias, running_mean, running_variance, epsilon_), in Launch()
/third_party/mindspore/mindspore/nn/layer/
Dquant.py89 … batch_mean, batch_std, running_mean, running_std = self.bn_train(x, mean, variance, global_step)
91 … batch_mean, batch_std, running_mean, running_std = self.bn_infer(x, mean, variance, global_step)
95 … _, batch_mean, batch_std, running_mean, running_std, mean_updated, variance_updated = \
102 running_mean = P.Add()(mean, 0.)
104 return batch_mean, batch_std, running_mean, running_std
1024 batch_mean, batch_std, running_mean, running_std = self.batchnorm_fold(out_conv,
1039 … batch_std, batch_mean, running_std, running_mean, self.step)
1043 … batch_std, batch_mean, running_std, running_mean, self.step)
1049 …ut = self.batchnorm_fold2_infer(out, self.beta, self.gamma, running_std, running_mean, running_std)