Sha256: bb0477da5e84460776d1437408e31cd2e0c540292e03e8cdd546a80f6d76f92c

Contents?: true

Size: 282 Bytes

Versions: 54

Compression:

Stored size: 282 Bytes

Contents

module Torch
  module NN
    class Hardshrink < Module
      def initialize(lambd: 0.5)
        super()
        @lambd = lambd
      end

      def forward(input)
        F.hardshrink(input, @lambd)
      end

      def extra_inspect
        @lambd.to_s
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
torch-rb-0.3.2 lib/torch/nn/hardshrink.rb
torch-rb-0.3.1 lib/torch/nn/hardshrink.rb
torch-rb-0.3.0 lib/torch/nn/hardshrink.rb
torch-rb-0.2.7 lib/torch/nn/hardshrink.rb
torch-rb-0.2.6 lib/torch/nn/hardshrink.rb
torch-rb-0.2.5 lib/torch/nn/hardshrink.rb
torch-rb-0.2.4 lib/torch/nn/hardshrink.rb
torch-rb-0.2.3 lib/torch/nn/hardshrink.rb
torch-rb-0.2.2 lib/torch/nn/hardshrink.rb
torch-rb-0.2.1 lib/torch/nn/hardshrink.rb
torch-rb-0.2.0 lib/torch/nn/hardshrink.rb
torch-rb-0.1.8 lib/torch/nn/hardshrink.rb
torch-rb-0.1.7 lib/torch/nn/hardshrink.rb
torch-rb-0.1.6 lib/torch/nn/hardshrink.rb