Class: Rumale::LinearModel::BaseSGD

Inherits:
Object
  • Object
show all
Includes:
Base::BaseEstimator
Defined in:
lib/rumale/linear_model/base_sgd.rb

Overview

BaseSGD is an abstract class for implementation of linear model with mini-batch stochastic gradient descent (SGD) optimization. This class is used internally.

Instance Attribute Summary

Attributes included from Base::BaseEstimator

#params

Instance Method Summary collapse

Constructor Details

#initializeBaseSGD

Create an initial linear model.



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/rumale/linear_model/base_sgd.rb', line 165

def initialize
  @params = {}
  @params[:learning_rate] = 0.01
  @params[:decay] = nil
  @params[:momentum] = 0.0
  @params[:bias_scale] = 1.0
  @params[:fit_bias] = true
  @params[:reg_param] = 0.0
  @params[:l1_ratio] = 0.0
  @params[:max_iter] = 1000
  @params[:batch_size] = 50
  @params[:tol] = 0.0001
  @params[:verbose] = false
  @penalty_type = nil
  @loss_func = nil
  @weight_vec = nil
  @bias_term = nil
  @n_iter = nil
  @rng = nil
end