Class: DNN::Models::FixedModel

Inherits:
Model show all
Defined in:
lib/dnn/core/models.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#last_log, #loss_weights, #optimizer

Instance Method Summary collapse

Methods inherited from Model

#add_callback, #add_lambda_callback, #built?, #call, #call_callbacks, #check_early_stop_requested, #clean_layers, #clear_callbacks, #copy, #evaluate, #evaluate_by_iterator, #get_all_params_data, #get_all_trainable_params, #get_layer, load, #load_params, #loss_func, #loss_func=, #predict, #predict1, #request_early_stop, #save, #save_params, #set_all_params_data, #setup, #test_on_batch, #test_step, #to_cpu, #to_gpu, #train, #train_by_iterator, #train_on_batch, #train_step, #trainable_layers

Methods inherited from Chain

#call, #load_hash, #to_hash

Constructor Details

#initialize(output_tensor, layers) ⇒ FixedModel

Returns a new instance of FixedModel.



1056
1057
1058
1059
1060
# File 'lib/dnn/core/models.rb', line 1056

def initialize(output_tensor, layers)
  super()
  @input_link = get_input_link(output_tensor.link)
  @layers = layers
end

Instance Attribute Details

#layersObject (readonly)

Returns the value of attribute layers.



1054
1055
1056
# File 'lib/dnn/core/models.rb', line 1054

def layers
  @layers
end

Instance Method Details

#forward(input_tensors) ⇒ Object



1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/dnn/core/models.rb', line 1062

def forward(input_tensors)
  if input_tensors.is_a?(Array)
    input_tensors.each do |tensor|
      @input_link.forward(tensor)
    end
  else
    @input_link.forward(input_tensors)
  end
end