What is bias?
Bias in deep learning is the constant term of a function that transforms m inputs into n outputs.
Below is a function that converts two inputs into three outputs.
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}; #Bias is a constant term 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 biases is the same as the number of outputs.
Bias is a parameter that is automatically adjusted
Bias is a parameter that is 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.