Bardo.Functions (Bardo v0.1.0)

View Source

The Functions module contains the activation functions used by the neuron, and other mathematical functions used by the system. Through the Functions module, the activation functions are fully decoupled from the neurons using them. A neuron can use any activation function, no matter its form, as long as it returns a properly formatted value.

NOTE: While the activation functions are all stored in the Functions module, the aggregation and the plasticity functions are stored in the SignalAggregator and Plasticity modules respectively.

Summary

Functions

The avg/1 function accepts a list for a parameter, and then returns the average of the list to the caller.

The bin/1 function converts val into a binary value, 1 if val > 0, and 0 if val <= 0.

The sat/3 function is similar to saturation/2 function, but here the max and min can be different, and are specified by the caller.

The sat_dzone/5 function is similar to the sat/3 function, but here, if val is between dzmin and dzmax, it is zeroed.

The function saturation/1 accepts a value val, and returns the same if its magnitude is below 1000. Otherwise it returns -1000 or 1000, if it's less than or greater than -1000 or 1000 respectively. Thus val saturates at -1000 and 1000.

The saturation/2 function is similar to saturation/1, but here the spread (symmetric max and min values) is specified by the caller.

The scale/3 function accepts a list of values, and scales them to be between the specified min and max values.

The std/1 function accepts a list for a parameter, and then returns to the caller the standard deviation of the list.

The trinary/1 function converts val into a trinary value.

Functions

absolute(val)

@spec absolute(float()) :: float()

avg(list)

@spec avg([float()]) :: float()

The avg/1 function accepts a list for a parameter, and then returns the average of the list to the caller.

bin(val)

@spec bin(float()) :: 0 | 1

The bin/1 function converts val into a binary value, 1 if val > 0, and 0 if val <= 0.

cartesian2polar(arg)

@spec cartesian2polar({float(), float()} | {float(), float(), any()}) ::
  {float(), float()}

cartesian2spherical(arg)

@spec cartesian2spherical({float(), float()} | {float(), float(), float()}) ::
  {float(), float(), float()}

cartesian(icoord, coord)

@spec cartesian([float()], [float()]) :: [float()]

cartesian(icoord, coord, list)

@spec cartesian([float()], [float()], [float()]) :: [float()]

cartesian_coord_diffs(icoord, coord)

@spec cartesian_coord_diffs([float()], [float()]) :: [float()]

cartesian_coord_diffs(from_coords, to_coords, list)

@spec cartesian_coord_diffs([float()], [float()], [float()]) :: [float()]

cartesian_distance(icoord, coord)

@spec cartesian_distance([float()], [float()]) :: [float()]

cartesian_distance(icoord, coord, list)

@spec cartesian_distance([float()], [float()], [float()]) :: [float()]

cartesian_gaussed_coord_diffs1(list1, list2, acc)

@spec cartesian_gaussed_coord_diffs1([float()], [float()], [float()]) :: [float()]

cartesian_gaussed_coord_diffs(from_coords, to_coords)

@spec cartesian_gaussed_coord_diffs([float()], [float()]) :: [float()]

cartesian_gaussed_coord_diffs(from_coords, to_coords, list)

@spec cartesian_gaussed_coord_diffs([float()], [float()], [float()]) :: [float()]

centripital_distances(icoord, coord)

@spec centripital_distances([float()], [float()]) :: [float()]

centripital_distances(icoord, coord, list)

@spec centripital_distances([float()], [float()], [float()]) :: [float()]

cos(val)

@spec cos(float()) :: float()

distance(vector1, vector2)

@spec distance([float()], [float()]) :: float()

distance(list1, list2, acc)

@spec distance([float()], [float()], float()) :: float()

gaussian(val)

@spec gaussian(float()) :: float()

gaussian(const, val)

@spec gaussian(float(), float()) :: float()

iow(icoord, coord, iow)

@spec iow([float()], [float()], [float()]) :: [float()]

linear(val)

@spec linear(float()) :: float()

log(value)

@spec log(float()) :: float()

multiquadric(val)

@spec multiquadric(float()) :: float()

normalize(vector)

@spec normalize([float()]) :: [float()]

polar2cartesian(arg)

@spec polar2cartesian({float(), float()}) :: {float(), float(), float()}

polar(icoord, coord)

@spec polar([float()], [float()]) :: [float()]

polar(icoord, coord, list)

@spec polar([float()], [float()], [float()]) :: [float()]

quadratic(val)

@spec quadratic(float()) :: float()

relu(val)

@spec relu(float()) :: float()

sat(val, min, max)

@spec sat(float(), float(), float()) :: float()

The sat/3 function is similar to saturation/2 function, but here the max and min can be different, and are specified by the caller.

sat_dzone(val, max, min, dzmax, dzmin)

@spec sat_dzone(float(), float(), float(), float(), float()) :: float()

The sat_dzone/5 function is similar to the sat/3 function, but here, if val is between dzmin and dzmax, it is zeroed.

saturation(val)

@spec saturation(float()) :: float()

The function saturation/1 accepts a value val, and returns the same if its magnitude is below 1000. Otherwise it returns -1000 or 1000, if it's less than or greater than -1000 or 1000 respectively. Thus val saturates at -1000 and 1000.

saturation(val, spread)

@spec saturation(float(), float()) :: float()

The saturation/2 function is similar to saturation/1, but here the spread (symmetric max and min values) is specified by the caller.

scale(val, max, min)

@spec scale(float() | [float()], float(), float()) :: float() | [float()]

The scale/3 function accepts a list of values, and scales them to be between the specified min and max values.

sgn(val)

@spec sgn(float()) :: -1 | 0 | 1

sigmoid1(val)

@spec sigmoid1(float()) :: float()

sigmoid(val)

@spec sigmoid(float()) :: float()

sin(val)

@spec sin(float()) :: float()

spherical2cartesian(arg)

@spec spherical2cartesian({float(), float(), float()}) :: {float(), float(), float()}

spherical(icoord, coord)

@spec spherical([float()], [float()]) :: [float()]

spherical(icoord, coord, list)

@spec spherical([float()], [float()], [float()]) :: [float()]

sqrt(val)

@spec sqrt(float()) :: float()

std(list)

@spec std([float()]) :: float()

The std/1 function accepts a list for a parameter, and then returns to the caller the standard deviation of the list.

std(list, avg, acc)

@spec std([float()], float(), [float()]) :: float()

tanh(val)

@spec tanh(float()) :: float()

to_cartesian(direction)

@spec to_cartesian(
  {:cartesian, any()}
  | {:polar, {float(), float()}}
  | {:spherical, {float(), float(), float()}}
) :: {:cartesian, any()}

trinary(val)

@spec trinary(float()) :: -1 | 0 | 1

The trinary/1 function converts val into a trinary value.

vector_difference(vector1, vector2)

@spec vector_difference([float()], [float()]) :: [float()]

vector_difference(list1, list2, acc)

@spec vector_difference([float()], [float()], [float()]) :: [float()]