/third_party/mindspore/tests/ut/python/nn/ |
D | test_l1_regularizer.py | 31 def construct(self, weights): argument 32 return self.l1_regularizer(weights) 37 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 40 l1_regularizer(weights) 47 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 50 l1_regularizer(weights) 57 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 60 l1_regularizer(weights) 67 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 70 l1_regularizer(weights) [all …]
|
/third_party/flutter/skia/third_party/externals/freetype/src/base/ |
D | ftlcdfil.c | 80 FT_LcdFiveTapFilter weights ) in ft_lcd_filter_fir() argument 109 fir[2] = weights[2] * val; in ft_lcd_filter_fir() 110 fir[3] = weights[3] * val; in ft_lcd_filter_fir() 111 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 114 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() 115 fir[2] = fir[3] + weights[2] * val; in ft_lcd_filter_fir() 116 fir[3] = fir[4] + weights[3] * val; in ft_lcd_filter_fir() 117 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 122 fir[0] = fir[1] + weights[0] * val; in ft_lcd_filter_fir() 123 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() [all …]
|
/third_party/skia/third_party/externals/freetype/src/base/ |
D | ftlcdfil.c | 79 FT_LcdFiveTapFilter weights ) in ft_lcd_filter_fir() argument 108 fir[2] = weights[2] * val; in ft_lcd_filter_fir() 109 fir[3] = weights[3] * val; in ft_lcd_filter_fir() 110 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 113 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() 114 fir[2] = fir[3] + weights[2] * val; in ft_lcd_filter_fir() 115 fir[3] = fir[4] + weights[3] * val; in ft_lcd_filter_fir() 116 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 121 fir[0] = fir[1] + weights[0] * val; in ft_lcd_filter_fir() 122 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() [all …]
|
/third_party/freetype/src/base/ |
D | ftlcdfil.c | 79 FT_LcdFiveTapFilter weights ) in ft_lcd_filter_fir() argument 108 fir[2] = weights[2] * val; in ft_lcd_filter_fir() 109 fir[3] = weights[3] * val; in ft_lcd_filter_fir() 110 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 113 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() 114 fir[2] = fir[3] + weights[2] * val; in ft_lcd_filter_fir() 115 fir[3] = fir[4] + weights[3] * val; in ft_lcd_filter_fir() 116 fir[4] = weights[4] * val; in ft_lcd_filter_fir() 121 fir[0] = fir[1] + weights[0] * val; in ft_lcd_filter_fir() 122 fir[1] = fir[2] + weights[1] * val; in ft_lcd_filter_fir() [all …]
|
/third_party/mindspore/mindspore/lite/tools/converter/quantizer/ |
D | mixed_bit_weight_quantizer.cc | 24 float MixedBitWeightQuantizer::MeasureQuantizationError(float *weights, const int *shape, int dims,… in MeasureQuantizationError() argument 26 MS_ASSERT(weights != nullptr); in MeasureQuantizationError() 47 float dequant = scale * (floorf(weights[i] / scale + 0.5)); in MeasureQuantizationError() 49 average_raw += weights[i]; in MeasureQuantizationError() 60 variance_raw += std::pow(weights[i] - average_raw, 2); in MeasureQuantizationError() 69 norms2[bucket] += weights[i] * weights[i]; in MeasureQuantizationError() 70 float dequant = var_corr_ * (scale * (floorf(weights[i] / scale + 0.5))) + mean_corr_; in MeasureQuantizationError() 71 float d = weights[i] - dequant; in MeasureQuantizationError() 96 BinarySearchResult MixedBitWeightQuantizer::BinarySearchForQuantizationScale(float *weights, int *s… in BinarySearchForQuantizationScale() argument 99 MS_ASSERT(weights != nullptr); in BinarySearchForQuantizationScale() [all …]
|
/third_party/boost/libs/random/test/ |
D | test_piecewise_linear.cpp | 29 piecewise_linear(const std::vector<double>& intervals, const std::vector<double>& weights) in piecewise_linear() argument 31 weights(weights), in piecewise_linear() 34 for(std::size_t i = 0; i < weights.size() - 1; ++i) { in piecewise_linear() 35 cumulative.push_back((weights[i] + weights[i + 1]) / 2); in piecewise_linear() 44 for(std::vector<double>::iterator iter = this->weights.begin(), end = this->weights.end(); in piecewise_linear() 49 assert(this->weights.size() == this->intervals.size()); in piecewise_linear() 50 assert(this->weights.size() == this->cumulative.size()); in piecewise_linear() 60 double lower_weight = weights[index - 1]; in cdf() 61 double upper_weight = weights[index]; in cdf() 71 std::vector<double> weights; member in piecewise_linear [all …]
|
D | test_piecewise_constant_distribution.cpp | 69 std::vector<double> weights = boost::assign::list_of(1)(2)(1)(4); in BOOST_AUTO_TEST_CASE() local 73 boost::random::piecewise_constant_distribution<> dist_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 83 intervals.begin(), intervals.end(), weights.begin()); in BOOST_AUTO_TEST_CASE() 117 std::vector<double> weights = boost::assign::list_of(1)(2)(1)(4); in BOOST_AUTO_TEST_CASE() local 120 boost::random::piecewise_constant_distribution<> dist(intervals, weights); in BOOST_AUTO_TEST_CASE() 159 parm_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 169 parm_it(intervals.begin(), intervals.end(), weights.begin()); in BOOST_AUTO_TEST_CASE() 191 std::vector<double> weights = boost::assign::list_of(1)(2)(1)(4); in BOOST_AUTO_TEST_CASE() local 195 boost::random::piecewise_constant_distribution<> dist_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 202 std::vector<double> weights = boost::assign::list_of(1)(2)(1)(4); in BOOST_AUTO_TEST_CASE() local [all …]
|
D | test_piecewise_linear_distribution.cpp | 71 std::vector<double> weights = boost::assign::list_of(3)(1)(2)(1)(2); in BOOST_AUTO_TEST_CASE() local 75 boost::random::piecewise_linear_distribution<> dist_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 85 intervals.begin(), intervals.end(), weights.begin()); in BOOST_AUTO_TEST_CASE() 121 std::vector<double> weights = boost::assign::list_of(3)(1)(2)(1)(2); in BOOST_AUTO_TEST_CASE() local 124 boost::random::piecewise_linear_distribution<> dist(intervals, weights); in BOOST_AUTO_TEST_CASE() 164 parm_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 174 parm_it(intervals.begin(), intervals.end(), weights.begin()); in BOOST_AUTO_TEST_CASE() 197 std::vector<double> weights = boost::assign::list_of(3)(1)(2)(1)(2); in BOOST_AUTO_TEST_CASE() local 201 boost::random::piecewise_linear_distribution<> dist_r(intervals, weights); in BOOST_AUTO_TEST_CASE() 208 std::vector<double> weights = boost::assign::list_of(3)(1)(2)(1)(2); in BOOST_AUTO_TEST_CASE() local [all …]
|
/third_party/mindspore/tests/ |
D | train_step_wrap.py | 32 self.weights = ParameterTuple(network.trainable_params()) 33 self.optimizer = nn.Momentum(self.weights, 0.1, 0.9) 38 weights = self.weights 39 grads = self.grad(self.network, weights)(x, label) 71 self.weights = ParameterTuple(network.get_parameters()) 72 self.optimizer = nn.Momentum(self.weights, 0.1, 0.9) 78 weights = self.weights 79 grads = self.grad(self.network, weights)(x, self.sens) 95 self.weights = ParameterTuple(network.trainable_params()) 99 grads = self.grad(self.network, self.weights)(x, label)
|
/third_party/boost/libs/graph/test/ |
D | graphviz_test.cpp | 49 weight_map_t const& weights, std::string const& node_id, 54 mass_map_t const& masses, weight_map_t const& weights, in test_graph() argument 59 return test_graph(dotfile, g, correct_num_vertices, masses, weights, in test_graph() 68 weight_map_t const& weights, std::string const& node_id, argument 115 if (!weights.empty()) 127 BOOST_CHECK(weights.find(edge_name) != weights.end()); 128 double ref_weight = weights.find(edge_name)->second; 191 weight_map_t weights; local 192 insert(weights)(make_pair("a", "b"), 0.0)(make_pair("c", "d"), 7.7)( 200 BOOST_CHECK((test_graph< graph_t >(gs, 6, mass_map_t(), weights))); [all …]
|
/third_party/boost/libs/compute/test/ |
D | test_discrete_distribution.cpp | 38 int weights[] = {2, 2}; in BOOST_AUTO_TEST_CASE() local 42 boost::compute::discrete_distribution<uint_> distribution(weights, weights+2); in BOOST_AUTO_TEST_CASE() 68 int weights[] = {10, 40, 40, 10}; in BOOST_AUTO_TEST_CASE() local 72 weights, weights + 4 in BOOST_AUTO_TEST_CASE() 134 std::vector<int> weights(1, 1); in BOOST_AUTO_TEST_CASE() local 137 weights.begin(), weights.end() in BOOST_AUTO_TEST_CASE() 168 std::vector<int> weights; in BOOST_AUTO_TEST_CASE() local 171 weights.begin(), weights.end() in BOOST_AUTO_TEST_CASE() 205 std::vector<int> weights(258, 0); in BOOST_AUTO_TEST_CASE() local 206 weights[257] = 1; in BOOST_AUTO_TEST_CASE() [all …]
|
/third_party/mindspore/tests/st/ops/cpu/ |
D | test_l1_regularizer_op.py | 31 def construct(self, weights): argument 32 return self.l1_regularizer(weights) 40 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 42 output = l1_regularizer(weights) 56 weights = Tensor(np.array([[1.0, -2.0], [-3.0, 4.0]]).astype(np.float32)) 57 output = net(weights) 69 weights = 2 71 output = net(weights) 83 weights = (1, 2, 3, 4) 85 output = net(weights)
|
/third_party/mindspore/tests/st/fl/hybrid_lenet/src/ |
D | cell_wrapper.py | 83 self.weights = optimizer.parameters 95 self.grad_reducer = DistributedGradReducer(self.weights, mean, degree) 110 def _pull_from_server(self, weights, names, indices): argument 111 result = self.hyper_map(F.partial(self.pull_weight_by_key), weights, names, indices) 114 def _push_to_server(self, weights, names, indices): argument 115 result = self.hyper_map(F.partial(self.push_weight_by_key), weights, names, indices) 119 def _pull_weight_inputs(weights): argument 125 for weight in weights: 135 def _push_weight_inputs(weights): argument 141 for weight in weights: [all …]
|
/third_party/mindspore/tests/ut/python/ops/ |
D | test_momentum.py | 55 def __init__(self, weights): argument 61 self.weights = weights 62 self.moments = weights.clone(prefix="moments", init='zeros') 69 weights = self.weights 73 grads, weights, moments) 83 self.weights = ParameterTuple(network.get_parameters()) 84 self.optimizer = OptimizerByMomentum(self.weights) 88 weights = self.weights 89 grads = grad_by_list(self.network, weights)(x, label)
|
/third_party/boost/boost/gil/image_processing/ |
D | hessian.hpp | 24 const detail::kernel_2d<T, Allocator>& weights, in compute_hessian_responses() argument 30 || weights.center_x() != weights.center_y()) in compute_hessian_responses() 45 auto center = weights.center_y(); in compute_hessian_responses() 53 for (typename OutputView::coord_t w_y = 0; w_y < weights.size(); ++w_y) in compute_hessian_responses() 55 for (typename OutputView::coord_t w_x = 0; w_x < weights.size(); ++w_x) in compute_hessian_responses() 58 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y); in compute_hessian_responses() 60 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y); in compute_hessian_responses() 62 .at(std::integral_constant<int, 0>{}) * weights.at(w_x, w_y); in compute_hessian_responses()
|
/third_party/boost/boost/math/quadrature/ |
D | gauss.hpp | 63 static const std::vector<Real>& weights() in weights() function in boost::math::quadrature::detail::gauss_detail 91 static std::array<T, 4> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 117 static std::array<T, 4> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 143 static std::array<T, 4> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 169 static std::array<T, 4> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 195 static std::array<T, 4> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 222 static std::array<T, 5> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 250 static std::array<T, 5> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 278 static std::array<T, 5> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail 306 static std::array<T, 5> const & weights() in weights() function in boost::math::quadrature::detail::gauss_detail [all …]
|
D | gauss_kronrod.hpp | 69 static const std::vector<Real>& weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 101 static std::array<T, 8> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 135 static std::array<T, 8> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 169 static std::array<T, 8> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 204 static std::array<T, 8> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 239 static std::array<T, 8> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 276 static std::array<T, 11> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 316 static std::array<T, 11> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 356 static std::array<T, 11> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail 397 static std::array<T, 11> const & weights() in weights() function in boost::math::quadrature::detail::gauss_kronrod_detail [all …]
|
/third_party/mindspore/mindspore/lite/src/delegate/tensorrt/ |
D | tensorrt_utils.cc | 123 nvinfer1::Weights weights{data_type, ms_tensor.Data().get(), ms_tensor.ElementNum()}; in ConvertConstantTensor() local 124 nvinfer1::IConstantLayer *constant_tensor = network->addConstant(dims, weights); in ConvertConstantTensor() 137 nvinfer1::Weights weights{ConvertDataType(data_type), value, 1}; in ConvertScalarToITensor() local 138 nvinfer1::IConstantLayer *constant_tensor = network->addConstant(dims, weights); in ConvertScalarToITensor() 192 nvinfer1::Weights weights{data_type, ms_tensor.Data().get(), ms_tensor.ElementNum()}; in ConvertTensorWithExpandDims() local 193 nvinfer1::IConstantLayer *constant_tensor = network->addConstant(dims, weights); in ConvertTensorWithExpandDims() 204 nvinfer1::Weights weights{}; in TransposeWeight() local 207 weights.type = nvinfer1::DataType::kHALF; in TransposeWeight() 208 weights.count = ms_tensor.ElementNum(); in TransposeWeight() 212 return weights; in TransposeWeight() [all …]
|
/third_party/boost/libs/numeric/odeint/examples/ |
D | adaptive_iterator.cpp | 105 vector< double > weights; in main() local 108 back_inserter( weights ) , in main() 111 for( size_t i=0 ; i<weights.size() ; ++i ) in main() 112 cout << weights[i] << "\n"; in main() 171 vector< double > weights; in main() local 172 … make_adaptive_time_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , back_inserter( weights ) , in main() 175 for( size_t i=0 ; i<weights.size() ; ++i ) in main() 176 cout << weights[i] << "\n"; in main() 274 vector< double > weights; in main() local 277 back_inserter( weights ) , in main() [all …]
|
D | const_step_iterator.cpp | 101 vector< double > weights; in main() local 104 back_inserter( weights ) , in main() 107 for( size_t i=0 ; i<weights.size() ; ++i ) in main() 108 cout << weights[i] << "\n"; in main() 117 vector< double > weights; in main() local 120 back_inserter( weights ) , in main() 123 for( size_t i=0 ; i<weights.size() ; ++i ) in main() 124 cout << weights[i] << "\n"; in main() 201 vector< double > weights; in main() local 202 …rm( make_const_step_range( stepper , lorenz() , x , 0.0 , 1.0 , 0.01 ) , back_inserter( weights ) , in main() [all …]
|
/third_party/mindspore/tests/ut/cpp/dataset/ |
D | weighted_random_sampler_test.cc | 50 std::vector<double> weights(total_samples, std::rand() % 100); in TEST_F() local 54 WeightedRandomSamplerRT m_sampler(weights, num_samples, true); in TEST_F() 79 std::vector<double> weights(total_samples, std::rand() % 100); in TEST_F() local 83 WeightedRandomSamplerRT m_sampler(weights, num_samples, false); in TEST_F() 115 std::vector<double> weights(total_samples, std::rand() % 100); in TEST_F() local 118 WeightedRandomSamplerRT m_sampler(weights, num_samples, true, samples_per_tensor); in TEST_F() 147 std::vector<double> weights(total_samples, std::rand() % 100); in TEST_F() local 148 weights[1] = 0; in TEST_F() 149 weights[2] = 0; in TEST_F() 153 WeightedRandomSamplerRT m_sampler(weights, num_samples, false, samples_per_tensor); in TEST_F() [all …]
|
/third_party/skia/third_party/externals/abseil-cpp/absl/random/ |
D | discrete_distribution_test.cc | 157 std::vector<double> weights(kBuckets, 0); in TEST() local 158 std::iota(std::begin(weights), std::end(weights), 1); in TEST() 159 absl::discrete_distribution<int> dist(std::begin(weights), std::end(weights)); in TEST() 174 for (double x : weights) { in TEST() 177 for (double& x : weights) { in TEST() 183 std::begin(weights), std::end(weights)); in TEST() 192 absl::StrAppend(&msg, i, ": ", counts[i], " vs ", weights[i], "\n"); in TEST()
|
/third_party/abseil-cpp/absl/random/ |
D | discrete_distribution_test.cc | 156 std::vector<double> weights(kBuckets, 0); in TEST() local 157 std::iota(std::begin(weights), std::end(weights), 1); in TEST() 158 absl::discrete_distribution<int> dist(std::begin(weights), std::end(weights)); in TEST() 173 for (double x : weights) { in TEST() 176 for (double& x : weights) { in TEST() 182 std::begin(weights), std::end(weights)); in TEST() 191 absl::StrAppend(&msg, i, ": ", counts[i], " vs ", weights[i], "\n"); in TEST()
|
/third_party/mindspore/mindspore/explainer/explanation/_attribution/_perturbation/ |
D | rise.py | 153 weights = masks * data + (1 - masks) * bg_data 154 weights = self._activation_fn(self.network(weights)) 155 while len(weights.shape) > 2: 156 weights = op.mean(weights, axis=2) 158 weights = np.expand_dims(np.expand_dims(weights.asnumpy()[:, targets[idx]], 2), 3) 160 attr_np[idx] += np.sum(weights * masks.asnumpy(), axis=0)
|
/third_party/mindspore/mindspore/explainer/explanation/_attribution/_backprop/ |
D | backprop_utils.py | 22 def get_bp_weights(model, inputs, targets=None, weights=None): argument 38 if targets is None and weights is None: 40 if weights is None: 44 weights = generate_one_hot(targets, num_categories) 45 return weights
|