Sha256: 56e0c3d64c1188aa08f6d222f5955aee081e6ad46d37d2db083bcd0966b3388d

Contents?: true

Size: 466 Bytes

Versions: 51

Compression:

Stored size: 466 Bytes

Contents

module Torch
  module Optim
    module LRScheduler
      class ExponentialLR < LRScheduler
        def initialize(optimizer, gamma, last_epoch: -1)
          @gamma = gamma
          super(optimizer, last_epoch)
        end

        def get_lr
          if @last_epoch == 0
            @base_lrs
          else
            @optimizer.param_groups.map do |group|
              group[:lr] * @gamma
            end
          end
        end
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
torch-rb-0.18.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.17.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.17.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.16.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.15.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.14.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.14.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.13.2 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.13.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.13.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.12.2 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.12.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.12.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.11.2 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.11.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.11.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.10.2 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.10.1 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.10.0 lib/torch/optim/lr_scheduler/exponential_lr.rb
torch-rb-0.9.2 lib/torch/optim/lr_scheduler/exponential_lr.rb