Dolores R6 Class

Dolores R6 Class

Details

Dolores is a simple feedforward neural network implementation. It uses backpropagation as learning mechanism.

Public fields

config

List of configuration values

weights

List of weights matrices

Methods

Public methods


Method new()

Create a new Dolores object.

Usage

Dolores$new(
  layers,
  learning_rate = 0.01,
  batch_size = 1,
  epochs = 10,
  cost = Cost$QUADRATIC
)

Arguments

layers

List of layers configurations created by layer()

learning_rate

Learning rate. Defaults to .01

batch_size

Batch size. Defaults to 1

epochs

Number of epochs. Defaults to 10

cost

Cost function vector defined as [function, function_derivative]Check out Cost enum for available functions. Defaults to Cost$QUADRATIC.

Returns

A new Dolores object.


Method train()

Train neural network.

Usage

Dolores$train(data)

Arguments

data

Training data in matrix or data frame format.

Returns

Current Dolores instance.


Method validate()

Validate neural network.

Usage

Dolores$validate(data)

Arguments

data

Test data in matrix or data frame format.

Returns

Returns output of cost function. It's usually a list of total and mean errors.


Method calculate()

Feed data into network and calculate output.

Usage

Dolores$calculate(data)

Arguments

data

Input data in matrix or data frame format.

Returns

Calculated output values.


Method clone()

The objects of this class are cloneable with this method.

Usage

Dolores$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.