Class: GRX::NN::LeakyReLU
Instance Method Summary collapse
- #forward(x) ⇒ Object
-
#initialize(alpha = 0.01) ⇒ LeakyReLU
constructor
A new instance of LeakyReLU.
- #to_s ⇒ Object
Methods inherited from Module
#call, #load_weights, #parameters, #save_weights, #zero_grad
Constructor Details
#initialize(alpha = 0.01) ⇒ LeakyReLU
Returns a new instance of LeakyReLU.
150 151 152 |
# File 'lib/grx/nn.rb', line 150 def initialize(alpha = 0.01) @alpha = alpha end |
Instance Method Details
#forward(x) ⇒ Object
153 |
# File 'lib/grx/nn.rb', line 153 def forward(x) = x.leaky_relu(@alpha) |
#to_s ⇒ Object
154 |
# File 'lib/grx/nn.rb', line 154 def to_s = "LeakyReLU(alpha=#{@alpha})" |