This website works better with JavaScript.
Home
Issues
Pull Requests
Milestones
AI流水线
Repositories
Datasets
Forum
实训
竞赛
大数据
AI开发
Register
Sign In
Huawei_Technology
/
mindspore
Not watched
Unwatch
Watch all
Watch but not notify
1
Star
0
Fork
0
Code
Releases
13
Wiki
evaluate
Activity
Issues
0
Pull Requests
0
Datasets
Model
Cloudbrain
HPC
Browse Source
!711
Address first epoch always shuffle with same seed init of random sampler
Merge pull request
!711
from ZiruiWu/mindspore_master_only
tags/v0.3.0-alpha
mindspore-ci-bot
Gitee
5 years ago
parent
afbd24cb78
8c3931cf1d
commit
c47ef8ee4e
2 changed files
with
2 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-1
mindspore/ccsrc/dataset/engine/datasetops/source/sampler/random_sampler.cc
+1
-1
tests/ut/python/dataset/test_datasets_celeba.py
+ 1
- 1
mindspore/ccsrc/dataset/engine/datasetops/source/sampler/random_sampler.cc
View File
@@ -53,6 +53,7 @@ Status RandomSampler::InitSampler() {
num_samples_ = (user_num_samples_ < num_samples_) ? user_num_samples_ : num_samples_;
CHECK_FAIL_RETURN_UNEXPECTED(num_samples_ > 0 && num_rows_ > 0, "both num_samples & num_rows need to be positive");
samples_per_buffer_ = samples_per_buffer_ > num_samples_ ? num_samples_ : samples_per_buffer_;
rnd_.seed(seed_++);
if (replacement_ == false) {
shuffled_ids_.reserve(num_rows_);
for (int64_t i = 0; i < num_rows_; i++) {
@@ -62,7 +63,6 @@ Status RandomSampler::InitSampler() {
} else {
dist = std::make_unique<std::uniform_int_distribution<int64_t>>(0, num_rows_ - 1);
}
rnd_.seed(seed_++);
return Status::OK();
}
+ 1
- 1
tests/ut/python/dataset/test_datasets_celeba.py
View File
@@ -20,7 +20,7 @@ DATA_DIR = "../data/dataset/testCelebAData/"
def test_celeba_dataset_label():
data = ds.CelebADataset(DATA_DIR, decode=True)
data = ds.CelebADataset(DATA_DIR, decode=True
, shuffle=False
)
expect_labels = [
[0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1,
0, 0, 1],
Write
Preview
Loading…
Cancel
Save