What is a weight?

Weights in deep learning are the "terms multiplied by inputs" of a function that transforms m inputs into n outputs.

Below is a function that converts two inputs into three outputs. The weights are expressed as column-major matrix.

use strict;
use warnings;

sub m_to_n_convert {
  my ($inputs) = @_;
  
  my $outputs = [];
  
  #Bias
  my $biases = [
    0.12,
    0.43,
    0.16,
  ];;
  
  # weight
  my $weights_mat = {
    rows_length => 3,
    columns_length => 2,
    values ​​=> [
      0.25,
      0.58,
      0.13,
      0.43,
      0.98,
      0.47,
    ]
  };;
  my $weights_mat_values ​​= $weights_mat->{values};
  
  #Weight is a term that is multiplied by the input of a function that transforms m inputs into n outputs.
  $outputs->[0] = $weights_mat_values->[0] * $inputs->[0] + $weights_mat_values->[3] * $inputs->[1] + $biases->[0];
  $outputs->[1] = $weights_mat_values->[1] * $inputs->[0] + $weights_mat_values->[4] * $inputs->[1] + $biases->[1];
  $outputs->[2] = $weights_mat_values->[2] * $inputs->[0] + $weights_mat_values->[5] * $inputs->[1] + $biases->[2];
  
  return $outputs;
}

The number of rows of weights is the same as the number of outputs. The number of columns of weights is the same as the number of inputs.

Weight is a parameter that is automatically adjusted

Weights are parameters that are automatically adjusted using a learning algorithm. The value of loss function, which is an index of error, is updated to be smaller. Parameter update algorithms such as gradient descent are used for the update.

Associated Information