Class: DNN::Layers::Softmax

Inherits:
Layer
  • Object
show all
Defined in:
lib/dnn/keras-model-convertor.rb

Instance Attribute Summary

Attributes inherited from Layer

#input_shape, #output_shape

Instance Method Summary collapse

Methods inherited from Layer

#<<, #build, #built?, #call, call, #clean, #compute_output_shape, from_hash, #initialize, #load_hash, #to_hash

Constructor Details

This class inherits a constructor from DNN::Layers::Layer

Instance Method Details

#forward(x) ⇒ Object



17
18
19
# File 'lib/dnn/keras-model-convertor.rb', line 17

def forward(x)
  Exp.(x) / Sum.(Exp.(x), axis: 1)
end