Code Monkey home page Code Monkey logo

Comments (1)

rfuruta avatar rfuruta commented on September 14, 2024

If you want to apply different actions on the 3 channels, I think the easiest way is to make different output layers for each channel.
For example, in init function in denoise/MyFCN.py:
conv7_pi_r=chainerrl.policies.SoftmaxPolicy(L.Convolution2D( 64, n_actions, 3, stride=1, pad=1, nobias=False, initialW=w)),
conv7_pi_g=chainerrl.policies.SoftmaxPolicy(L.Convolution2D( 64, n_actions, 3, stride=1, pad=1, nobias=False, initialW=w)),
conv7_pi_b=chainerrl.policies.SoftmaxPolicy(L.Convolution2D( 64, n_actions, 3, stride=1, pad=1, nobias=False, initialW=w)),
conv7_V_r=L.Convolution2D( 64, 1, 3, stride=1, pad=1, nobias=False, initialW=net.layer18.W.data, initial_bias=net.layer18.b.data),
conv7_V_g=L.Convolution2D( 64, 1, 3, stride=1, pad=1, nobias=False, initialW=net.layer18.W.data, initial_bias=net.layer18.b.data),
conv7_V_b=L.Convolution2D( 64, 1, 3, stride=1, pad=1, nobias=False, initialW=net.layer18.W.data, initial_bias=net.layer18.b.data),
and in pi_and_v function:
pout_r = self.conv7_pi_r(h_pi)
pout_g = self.conv7_pi_g(h_pi)
pout_b = self.conv7_pi_b(h_pi)
vout_r = self.conv7_V_r(h_V)
vout_g = self.conv7_V_g(h_V)
vout_b = self.conv7_V_b(h_V)
return pout_r, pout_g, pout_b, vout_r, vout_g, vout_b

Then, modify the pixelwise_a3c.py. You can independently treat pout_r, pout_g, and pout_b in the same manner as pout. The pi_loss is replaced with the sum of pi_loss_r, pi_loss_g, and pi_loss_b. Similarly, you can treat vout_r, vout_g, and vout_b. In this way, you don't have to modify the SoftmaxPolicy layer.

from pixelrl.

Related Issues (13)

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.