Home
last modified time | relevance | path

Searched refs:num_samples_ (Results 1 – 25 of 38) sorted by relevance

12

/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/datasetops/source/sampler/
Dsequential_sampler.cc27 if (id_count_ > num_samples_) { in GetNextSample()
30 std::to_string(id_count_) + ", num_samples_: " + std::to_string(num_samples_)); in GetNextSample()
31 } else if (id_count_ == num_samples_) { in GetNextSample()
42 int64_t remaining_ids = num_samples_ - id_count_; in GetNextSample()
75 CHECK_FAIL_RETURN_UNEXPECTED(num_samples_ >= 0, in InitSampler()
77 std::to_string(num_samples_) + ".\n"); in InitSampler()
81 if (num_samples_ == 0 || num_samples_ > available_row_count) { in InitSampler()
82 num_samples_ = available_row_count; in InitSampler()
84 CHECK_FAIL_RETURN_UNEXPECTED((num_samples_ > 0 && samples_per_tensor_ > 0) || num_samples_ == 0, in InitSampler()
87 samples_per_tensor_ = samples_per_tensor_ > num_samples_ ? num_samples_ : samples_per_tensor_; in InitSampler()
[all …]
Dweighted_random_sampler.cc41 if (num_samples_ == 0 || num_samples_ > num_rows_) { in InitSampler()
42 num_samples_ = num_rows_; in InitSampler()
45 num_rows_ > 0 && num_samples_, in InitSampler()
47 std::to_string(num_rows_) + ", num_samples: " + std::to_string(num_samples_)); in InitSampler()
58 if (!replacement_ && (weights_.size() < static_cast<size_t>(num_samples_))) { in InitSampler()
62 std::to_string(weights_.size()) + ", num_samples: " + std::to_string(num_samples_)); in InitSampler()
68 samples_per_tensor_ = (samples_per_tensor_ > num_samples_) ? num_samples_ : samples_per_tensor_; in InitSampler()
91 std::partial_sort(val_idx.begin(), val_idx.begin() + num_samples_, val_idx.end()); in InitOnePassSampling()
92 for (int64_t i = 0; i < num_samples_; i++) { in InitOnePassSampling()
123 if (!replacement_ && (weights_.size() < static_cast<size_t>(num_samples_))) { in GetNextSample()
[all …]
Dpk_sampler.cc54 if (num_samples_ == 0 || num_samples_ > num_rows_) { in InitSampler()
55 num_samples_ = num_rows_; in InitSampler()
58 samples_per_tensor_ = (samples_per_tensor_ > num_samples_) ? num_samples_ : samples_per_tensor_; in InitSampler()
65num_samples_ > 0, "Invalid parameter, num_class or num samples per class must be greater than 0, b… in InitSampler()
66 std::to_string(num_samples_)); in InitSampler()
72 if (next_id_ > num_samples_ || num_samples_ == 0) { in GetNextSample()
75 std::to_string(next_id_) + ", num_samplers:" + std::to_string(num_samples_)); in GetNextSample()
76 } else if (next_id_ == num_samples_) { in GetNextSample()
84 …int64_t last_id = (samples_per_tensor_ + next_id_ > num_samples_) ? num_samples_ : samples_per_ten… in GetNextSample()
108 …CHECK_FAIL_RETURN_UNEXPECTED(next_id_ == num_samples_, "[Internal ERROR] Reset() Sampler called ea… in ResetSampler()
Drandom_sampler.cc34 if (next_id_ > num_samples_) { in GetNextSample()
36 … std::to_string(next_id_) + ", num_samplers:" + std::to_string(num_samples_)); in GetNextSample()
37 } else if (next_id_ == num_samples_) { in GetNextSample()
45 int64_t last_id = std::min(samples_per_tensor_ + next_id_, num_samples_); in GetNextSample()
75 if (num_samples_ == 0 || num_samples_ > num_rows_) { in InitSampler()
76 num_samples_ = num_rows_; in InitSampler()
79 num_samples_ > 0 && num_rows_ > 0, in InitSampler()
81 std::to_string(num_samples_) + ", num_rows: " + std::to_string(num_rows_)); in InitSampler()
82 samples_per_tensor_ = samples_per_tensor_ > num_samples_ ? num_samples_ : samples_per_tensor_; in InitSampler()
100 …CHECK_FAIL_RETURN_UNEXPECTED(next_id_ == num_samples_, "[Internal ERROR] Reset() Sampler called ea… in ResetSampler()
Dsubset_sampler.cc34 if (num_samples_ == 0 || num_samples_ > static_cast<int64_t>(indices_.size())) { in InitSampler()
35 num_samples_ = static_cast<int64_t>(indices_.size()); in InitSampler()
38 if (samples_per_tensor_ > num_samples_) { in InitSampler()
39 samples_per_tensor_ = num_samples_; in InitSampler()
61 if (sample_id_ == num_samples_) { in GetNextSample()
72 if (last_id > num_samples_) { in GetNextSample()
73 last_id = num_samples_; in GetNextSample()
130 int64_t res = (num_samples_ > 0) ? std::min(child_num_rows, num_samples_) : child_num_rows; in CalculateNumSamples()
Ddistributed_sampler.cc49 if (num_samples_ == 0 || num_samples_ > num_rows_) { in InitSampler()
50 num_samples_ = num_rows_; in InitSampler()
52 …CHECK_FAIL_RETURN_UNEXPECTED(num_samples_ > 0, "Invalid parameter, num_samples must be greater tha… in InitSampler()
53 std::to_string(num_samples_) + ".\n"); in InitSampler()
57 device_id_ < num_devices_ && device_id_ >= 0 && num_rows_ > 0 && num_samples_ > 0, in InitSampler()
78 samples_per_tensor_ = num_samples_ < samples_per_tensor_ ? num_samples_ : samples_per_tensor_; in InitSampler()
180 …int64_t num_samples = (num_samples_ > 0) ? std::min(child_num_rows, num_samples_) : child_num_rows; in CalculateNumSamples()
Dsampler.cc38 num_samples_(num_samples), in SamplerRT()
60 num_rows_ = child_sampler->num_samples_; in HandshakeRandomAccessOp()
88 out << "\nnum_rows_: " << num_rows_ << "\nnum_samples_: " << num_samples_; in SamplerPrint()
127 num_samples_ = num_samples; in SetNumSamples()
131 int64_t SamplerRT::GetNumSamples() const { return num_samples_; } in GetNumSamples()
141 return (num_samples_ > 0) ? std::min(child_num_rows, num_samples_) : child_num_rows; in CalculateNumSamples()
188 args["num_samples"] = num_samples_; in to_json()
Dmind_record_sampler.cc26 if (next_id_ > num_samples_) { in GetNextSample()
29 std::to_string(next_id_) + ", num_samples_: " + std::to_string(num_samples_)); in GetNextSample()
30 } else if (next_id_ == num_samples_) { in GetNextSample()
34 int64_t last_id = std::min(samples_per_tensor_ + next_id_, num_samples_); in GetNextSample()
58 num_samples_ = sample_ids_->size(); in InitSampler()
Dpython_sampler.cc73 if (num_samples_ == 0 || num_samples_ > num_rows_) { in InitSampler()
74 num_samples_ = num_rows_; in InitSampler()
82 py_sampler_instance.attr("_handshake")(num_rows_, num_samples_); in InitSampler()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/api/
Dsamplers.cc37 num_samples_(num_samples), in DistributedSampler()
43 …return std::make_shared<DistributedSamplerObj>(num_shards_, shard_id_, shuffle_, num_samples_, see… in Parse()
49 : num_val_(num_val), shuffle_(shuffle), num_samples_(num_samples) {} in PKSampler()
52 return std::make_shared<PKSamplerObj>(num_val_, shuffle_, num_samples_); in Parse()
57 : replacement_(replacement), num_samples_(num_samples) {} in RandomSampler()
60 return std::make_shared<RandomSamplerObj>(replacement_, num_samples_); in Parse()
65 : start_index_(start_index), num_samples_(num_samples) {} in SequentialSampler()
68 return std::make_shared<SequentialSamplerObj>(start_index_, num_samples_); in Parse()
73 : indices_(indices), num_samples_(num_samples) {} in SubsetSampler()
76 return std::make_shared<SubsetSamplerObj>(indices_, num_samples_); in Parse()
[all …]
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/samplers/
Dpk_sampler_ir.cc35 : num_val_(num_val), shuffle_(shuffle), num_samples_(num_samples) {} in PKSamplerObj()
45 if (num_samples_ < 0) { in ValidateParams()
47 std::to_string(num_samples_)); in ValidateParams()
58 args["num_samples"] = num_samples_; in to_json()
78 *sampler = std::make_shared<dataset::PKSamplerRT>(num_val_, shuffle_, num_samples_); in SamplerBuild()
90 GetSeed(), num_samples_); in BuildForMindDataset()
92 mind_sampler = std::make_shared<mindrecord::ShardPkSample>("label", num_val_, num_samples_); in BuildForMindDataset()
100 auto sampler = std::make_shared<PKSamplerObj>(num_val_, shuffle_, num_samples_); in SamplerCopy()
Dsequential_sampler_ir.cc35 : start_index_(start_index), num_samples_(num_samples) {} in SequentialSamplerObj()
41 if (num_samples_ < 0) { in ValidateParams()
43 std::to_string(num_samples_)); in ValidateParams()
59 args["num_samples"] = num_samples_; in to_json()
78 *sampler = std::make_shared<dataset::SequentialSamplerRT>(start_index_, num_samples_); in SamplerBuild()
87 …auto mind_sampler = std::make_shared<mindrecord::ShardSequentialSample>(num_samples_, start_index_… in BuildForMindDataset()
93 auto sampler = std::make_shared<SequentialSamplerObj>(start_index_, num_samples_); in SamplerCopy()
Drandom_sampler_ir.cc35 …: replacement_(replacement), num_samples_(num_samples), reshuffle_each_epoch_(reshuffle_each_epoch… in RandomSamplerObj()
41 if (num_samples_ < 0) { in ValidateParams()
43 std::to_string(num_samples_)); in ValidateParams()
54 args["num_samples"] = num_samples_; in to_json()
75 …*sampler = std::make_shared<dataset::RandomSamplerRT>(replacement_, num_samples_, reshuffle_each_e… in SamplerBuild()
85 …std::make_shared<mindrecord::ShardShuffle>(GetSeed(), num_samples_, replacement_, reshuffle_each_e… in BuildForMindDataset()
92 …auto sampler = std::make_shared<RandomSamplerObj>(replacement_, num_samples_, reshuffle_each_epoch… in SamplerCopy()
Dsubset_sampler_ir.cc35 : indices_(std::move(indices)), num_samples_(num_samples) {} in SubsetSamplerObj()
41 if (num_samples_ < 0) { in ValidateParams()
43 std::to_string(num_samples_)); in ValidateParams()
51 *sampler = std::make_shared<dataset::SubsetSamplerRT>(indices_, num_samples_); in SamplerBuild()
70 args["num_samples"] = num_samples_; in to_json()
87 auto sampler = std::make_shared<SubsetSamplerObj>(indices_, num_samples_); in SamplerCopy()
Dweighted_random_sampler_ir.cc26 : weights_(std::move(weights)), num_samples_(num_samples), replacement_(replacement) {} in WeightedRandomSamplerObj()
48 if (num_samples_ < 0) { in ValidateParams()
50 std::to_string(num_samples_)); in ValidateParams()
61 args["num_samples"] = num_samples_; in to_json()
81 …*sampler = std::make_shared<dataset::WeightedRandomSamplerRT>(weights_, num_samples_, replacement_… in SamplerBuild()
87 auto sampler = std::make_shared<WeightedRandomSamplerObj>(weights_, num_samples_, replacement_); in SamplerCopy()
Ddistributed_sampler_ir.cc39 num_samples_(num_samples), in DistributedSamplerObj()
64 if (num_samples_ < 0) { in ValidateParams()
66 std::to_string(num_samples_)); in ValidateParams()
79 …::make_shared<dataset::DistributedSamplerRT>(num_shards_, shard_id_, shuffle_, num_samples_, seed_, in SamplerBuild()
90 num_samples_, offset_); in BuildForMindDataset()
104 args["num_samples"] = num_samples_; in to_json()
135 …std::make_shared<DistributedSamplerObj>(num_shards_, shard_id_, shuffle_, num_samples_, seed_, off… in SamplerCopy()
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/engine/ir/datasetops/source/
Dusps_node.cc35 num_samples_(num_samples), in USPSNode()
47 …auto node = std::make_shared<USPSNode>(dataset_dir_, usage_, num_samples_, shuffle_, num_shards_, … in Copy()
54 ", num_samples:" + std::to_string(num_samples_) + ")"); in Print()
62 if (num_samples_ < 0) { in ValidateParams()
63 std::string err_msg = "USPSNode: Invalid number of samples: " + std::to_string(num_samples_); in ValidateParams()
83num_samples_, connector_que_size_, shuffle_files, num_shards_, shard_id_); in Build()
123 int64_t num_rows, sample_size = num_samples_; in GetDatasetSize()
136 args["num_samples"] = num_samples_; in to_json()
156 *sampler = SelectSampler(num_samples_, shuffle_files, num_shards_, shard_id_); in SetupSamplerForCache()
167 num_samples_ = 0; in MakeSimpleProducer()
Dtext_file_node.cc30 num_samples_(num_samples), in TextFileNode()
42 …auto node = std::make_shared<TextFileNode>(dataset_files_, num_samples_, shuffle_, num_shards_, sh… in Copy()
61 if (num_samples_ < 0) { in ValidateParams()
62 … std::string err_msg = "TextFileNode: Invalid number of samples: " + std::to_string(num_samples_); in ValidateParams()
86 …std::make_shared<TextFileOp>(num_workers_, num_samples_, worker_connector_size_, std::move(schema), in Build()
131 int64_t num_rows, sample_size = num_samples_; in GetDatasetSize()
143 args["num_samples"] = num_samples_; in to_json()
183 *sampler = SelectSampler(num_samples_, shuffle_files, num_shards_, shard_id_); in SetupSamplerForCache()
194 num_samples_ = 0; in MakeSimpleProducer()
Dtf_record_node.cc38 …node = std::make_shared<TFRecordNode>(dataset_files_, schema_obj_, columns_list_, num_samples_, sh… in Copy()
41 …node = std::make_shared<TFRecordNode>(dataset_files_, schema_path_, columns_list_, num_samples_, s… in Copy()
48 …out << (Name() + "(num_samples:" + std::to_string(num_samples_) + ",num_shards:" + std::to_string(… in Print()
74 if (num_samples_ < 0) { in ValidateParams()
75 … std::string err_msg = "TFRecordNode: Invalid number of samples: " + std::to_string(num_samples_); in ValidateParams()
132 …num_workers_, worker_connector_size_, num_samples_, sorted_dir_files, std::move(data_schema), conn… in Build()
192 *dataset_size = num_samples_ > 0 ? std::min(num_rows, num_samples_) : num_rows; in GetDatasetSize()
217 args["num_samples"] = num_samples_; in to_json()
231 schema_obj_->set_num_rows(num_samples_); in to_json()
285 *sampler = SelectSampler(num_samples_, shuffle_files, num_shards_, shard_id_); in SetupSamplerForCache()
[all …]
Dcsv_node.cc35 num_samples_(num_samples), in CSVNode()
47 …::make_shared<CSVNode>(dataset_files_, field_delim_, column_defaults_, column_names_, num_samples_, in Copy()
73 if (num_samples_ < 0) { in ValidateParams()
74 std::string err_msg = "CSVNode: Invalid number of samples: " + std::to_string(num_samples_); in ValidateParams()
117 …sorted_dataset_files, field_delim_, column_default_list, column_names_, num_workers_, num_samples_, in Build()
164 sample_size = num_samples_; in GetDatasetSize()
177 args["num_samples"] = num_samples_; in to_json()
223 *sampler = SelectSampler(num_samples_, shuffle_files, num_shards_, shard_id_); in SetupSamplerForCache()
234 num_samples_ = 0; in MakeSimpleProducer()
Dclue_node.cc32 num_samples_(num_samples), in CLUENode()
39 …std::make_shared<CLUENode>(dataset_files_, task_, usage_, num_samples_, shuffle_, num_shards_, sha… in Copy()
62 if (num_samples_ < 0) { in ValidateParams()
63 std::string err_msg = "CLUENode: Invalid number of samples: " + std::to_string(num_samples_); in ValidateParams()
178 …std::make_shared<ClueOp>(num_workers_, num_samples_, worker_connector_size_, ck_map, sorted_datase… in Build()
225 sample_size = num_samples_; in GetDatasetSize()
238 args["num_samples"] = num_samples_; in to_json()
281 *sampler = SelectSampler(num_samples_, shuffle_files, num_shards_, shard_id_); in SetupSamplerForCache()
292 num_samples_ = 0; in MakeSimpleProducer()
Dtf_record_node.h45 num_samples_(num_samples), in TFRecordNode()
66 num_samples_(num_samples), in TFRecordNode()
119 int64_t NumSamples() const { return num_samples_; } in NumSamples()
168 int64_t num_samples_; variable
/third_party/mindspore/mindspore/ccsrc/backend/kernel_compiler/gpu/random/
Drandom_categorical_gpu_kernel.h32 …lGpuKernel() : is_null_input_(false), batch_size_(0), num_classes_(0), num_samples_(0), seed_(0) {} in RandomCategoricalGpuKernel()
68 host_1d_rand = std::make_unique<double[]>(num_samples_); in Launch()
72 for (size_t j = 0; j < num_samples_; j++) { in Launch()
77 host_1d_rand.get(), sizeof(double) * num_samples_, in Launch()
88 RandomCategoricalKernel(num_samples_, dev_rand, dev_cdf, batch_size_, num_classes_, output_addr, in Launch()
121 num_samples_ = LongToSize(GetAttr<int64_t>(kernel_node, "num_samples")); in Init()
135 output_size_list_.push_back(sizeof(S) * batch_size_ * num_samples_); in InitSizeLists()
143 workspace_size_list_.push_back(sizeof(double) * num_samples_); in InitSizeLists()
152 size_t num_samples_; variable
/third_party/mindspore/mindspore/ccsrc/minddata/dataset/include/dataset/
Dsamplers.h103 int64_t num_samples_; variable
133 int64_t num_samples_; variable
157 int64_t num_samples_; variable
181 int64_t num_samples_; variable
204 int64_t num_samples_; variable
250 int64_t num_samples_; variable
/third_party/mindspore/mindspore/ccsrc/minddata/mindrecord/meta/
Dshard_pk_sample.cc28 num_samples_(num_samples) {} in ShardPkSample()
32 …(category_field, num_elements, num_categories, true), shuffle_(false), num_samples_(num_samples) {} in ShardPkSample()
36 …ry(category_field, num_elements, num_categories, true), shuffle_(true), num_samples_(num_samples) { in ShardPkSample()

12