Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotation for image augmentation WIP #1955

Merged
merged 5 commits into from Nov 2, 2017

Conversation

YiwenShaoStephen
Copy link
Contributor

No description provided.

@danpovey
Copy link
Contributor

Some issues I notice here are: it should default to cifar10 in the script not cifar100 (next time don't change the script, run with "--dataset cifar100"). And the rotation-with-some-probability thing probably needs a flag for it, e.g. --rotation-prob.

@YiwenShaoStephen
Copy link
Contributor Author

Which scripts do I need to add the new image augmentation options (i.e. rotation-degree, rotation-prob)? Only the resnet_1* or all scripts?

@danpovey
Copy link
Contributor

danpovey commented Oct 25, 2017 via email

@YiwenShaoStephen
Copy link
Contributor Author

Do I need to also include the changes on the number of filters and epochs in the new recipe that achieves better result? For example, I can make a resnet_1d with rotation only, resnet_1e with changes on epochs and filters, and finally resnet_1f with them together.

@danpovey
Copy link
Contributor

danpovey commented Oct 25, 2017 via email

@YiwenShaoStephen
Copy link
Contributor Author

OK. I notice that in each recipe, there are some lines of comments on the top showing the results of that recipe. For this reason, it might take me some time to get completed results of these new recipes. (My previous experiments are mainly on cifar100)

@YiwenShaoStephen
Copy link
Contributor Author

I've pushed these two recipes. But the results in top few lines are not completed. Only the result in resnet_1e for cifar100 is up-to-date. I will update other information upon getting the results.

@YiwenShaoStephen
Copy link
Contributor Author

All results updated. Ready for merging.

@danpovey
Copy link
Contributor

danpovey commented Oct 27, 2017 via email

Copy link
Contributor

@hhadian hhadian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's OK for merging, but here are 2 comments to make the code nicer:

@@ -231,6 +241,14 @@ void PerturbImage(const ImageAugmentationConfig &config,
// [ cos(theta) -sin(theta) 0
// sin(theta) cos(theta) 0
// 0 0 1 ]
if (RandUniform() <= config.rotation_prob) {
BaseFloat theta = (2 * config.rotation_degree * RandUniform() -
config.rotation_degree) / 180.0 * 3.1415926;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could use Kaldi constant M_PI

@@ -231,6 +241,14 @@ void PerturbImage(const ImageAugmentationConfig &config,
// [ cos(theta) -sin(theta) 0
// sin(theta) cos(theta) 0
// 0 0 1 ]
if (RandUniform() <= config.rotation_prob) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you could use Kaldi's WithProb() which makes it nicer.
Not important though.

@danpovey
Copy link
Contributor

danpovey commented Oct 27, 2017 via email

@YiwenShaoStephen
Copy link
Contributor Author

Thanks. I've replaced 3.1415 with M_PI.

@danpovey danpovey merged commit 148c884 into kaldi-asr:master Nov 2, 2017
kronos-cm added a commit to kronos-cm/kaldi that referenced this pull request Nov 4, 2017
* 'master' of https://github.com/kaldi-asr/kaldi:
  [src,scripts] nnet1-related changes: (kaldi-asr#1998)
  [egs] rotation for image augmentation in CIFAR example (kaldi-asr#1955)
  [egs] Minor fixes to the SRE16 v2 recipe (kaldi-asr#1986)
  [egs] Remove deprecated non-working scripts
  [scripts] Fixes to segment_long_utterances.sh (thanks @christophfeinauer) and train_raw_dnn.py (kaldi-asr#1993)
  [src] Minor fix: change to error message (kaldi-asr#1980)
  [egs] Add example of component-level l2-regularize for WSJ scripts
  [egs] Small fix to Chime4 RE data location (kaldi-asr#1966)
  [build] Remove download of ATLAS header files from tools/. (kaldi-asr#1974)
xiaohui-zhang pushed a commit to xiaohui-zhang/kaldi that referenced this pull request Nov 14, 2017
mahsa7823 pushed a commit to mahsa7823/kaldi that referenced this pull request Feb 28, 2018
Skaiste pushed a commit to Skaiste/idlak that referenced this pull request Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants