Class TTinyNN

Unit

Declaration

type TTinyNN = class(TObject)

Description

Tiny neural network main class

Hierarchy

  • TObject
  • TTinyNN

Overview

Methods

Protected function err(const a: Single; const b: Single): Single;
Protected function pderr(const a: Single; const b: Single): Single;
Protected function toterr(index: Integer): Single;
Protected function act(const a: Single): Single;
Protected function pdact(const a: Single): Single;
Protected procedure bprop(const rate: Single);
Protected procedure fprop;
Protected procedure wbrand;
Public function Train(const rate: Single; index: Integer): Single;
Public procedure Build(nips: Integer; nhid: Integer; nops: Integer);
Public function Predict(index: Integer): TSingleArray;
Public procedure SaveToFile(path: String);
Public procedure LoadFromFile(path: String);
Public procedure PrintToScreen(arr: TSingleArray; size: Integer);
Public procedure SetData(inp: TTinnData);
Public procedure ShuffleData;

Description

Methods

Protected function err(const a: Single; const b: Single): Single;

Calculates error

Protected function pderr(const a: Single; const b: Single): Single;

Calculates partial derivative of error function

Protected function toterr(index: Integer): Single;

Calculates total error of output target

Protected function act(const a: Single): Single;

Activation function

Protected function pdact(const a: Single): Single;

Returns partial derivative of activation function

Protected procedure bprop(const rate: Single);

Performs back propagation

Protected procedure fprop;

Performs forward propagation

Protected procedure wbrand;

Randomize weights and baises

Public function Train(const rate: Single; index: Integer): Single;

Trains a tinn with an input and target output with a learning rate. Returns target to output error

Public procedure Build(nips: Integer; nhid: Integer; nops: Integer);

Prepare the TPasTinn record for usage

Public function Predict(index: Integer): TSingleArray;

Returns an output prediction on given input

Public procedure SaveToFile(path: String);

Save neural network to file

Public procedure LoadFromFile(path: String);

Load neural network from file

Public procedure PrintToScreen(arr: TSingleArray; size: Integer);

Dump contents of array to screen

Public procedure SetData(inp: TTinnData);

Set input data

Public procedure ShuffleData;

Shuffle input data


Generated by PasDoc 0.15.0.