Giter Club home page Giter Club logo

Comments (5)

shimhyeonwoo avatar shimhyeonwoo commented on May 28, 2024 1

Oh, there is more appropriate distribution.

mirror {
  rand_type: "bernoulli"
  prob: 0.3
}

Thank you.

from flownet2.

nikolausmayer avatar nikolausmayer commented on May 28, 2024

Hi,

to use the horizontal flip augmentation, add this to your augmentation layer's prototxt, in the augmentation_param section:

mirror {
  rand_type: "uniform_bernoulli"
  exp: false
  mean: XXX
  spread: XXX
  prob: 1.0
}

You might also need to add it to the GenerateAugmentationParameters layer. Note that you need to specify the "XXX" parameters which determine when this augmentation triggers.

from flownet2.

shimhyeonwoo avatar shimhyeonwoo commented on May 28, 2024

I really appreciate for your help!

from flownet2.

shimhyeonwoo avatar shimhyeonwoo commented on May 28, 2024

About adjusting "XXX" parameters...

refering to "message AugmentationCoeff" in "caffe.proto", the default value of "float mirror" is zero:

message AugmentationCoeff {
  // Spatial
  optional float mirror = 1 [default = 0];
  optional float dx = 2 [default = 0];
  optional float dy = 3 [default = 0];
  optional float angle = 4 [default = 0];
  optional float zoom_x = 5 [default = 1];
  optional float zoom_y = 6 [default = 1];

And line 138, in "augmentation_layer_base.cpp", it seems I can use mirror augmentation when "float mirror" is not zero. maybe it means, when the "mirror" is not zero it always flip data :

            // move the origin and mirror
            if (coeff.mirror()) {
                x1 = - static_cast<Dtype>(x) + .5 * static_cast<Dtype>(cropped_width);
                y1 =   static_cast<Dtype>(y) - .5 * static_cast<Dtype>(cropped_height);
            }  else {
                x1 =   static_cast<Dtype>(x) - .5 * static_cast<Dtype>(cropped_width);
                y1 =   static_cast<Dtype>(y) - .5 * static_cast<Dtype>(cropped_height);
            }

If my opinion were right, and I want use horizontal flip with only, for example, 30%, how about use the parameter like this?

mirror {
  rand_type: "uniform_bernoulli"
  exp: false
  mean: 1
  spread: 0
  prob: 0.3
}

or

mirror {
  rand_type: "uniform_bernoulli"
  exp: false
  mean: 0
  spread: 0
  prob: 0.7
}

from flownet2.

nikolausmayer avatar nikolausmayer commented on May 28, 2024

I want use horizontal flip with only, for example, 30%

You can choose from different distributions; check rng.cpp for a list and the implementations. If you want a fixed 30% probability for a binary decision, you might want to use the bernoulli variant with the prob parameter set to 0.3.

from flownet2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.