Options
All
  • Public
  • Public/Protected
  • All
Menu

Carrot - v0.4.0

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

datasetType

datasetType: { input: number[]; output: number[] }[]

fitnessFunction

fitnessFunction: (population: Iterable<Network>, dataset?: datasetType) => void

Type declaration

lossType

lossType: (targets: number[], outputs: number[]) => number

Type declaration

    • (targets: number[], outputs: number[]): number
    • Parameters

      • targets: number[]
      • outputs: number[]

      Returns number

Variables

Const ALL_INSTINCT_MUTATIONS

ALL_INSTINCT_MUTATIONS: Mutation[] = [new AddNodeMutation(),new SubNodeMutation(),new AddConnectionMutation(),new SubConnectionMutation(),new ModWeightMutation(),new ModBiasMutation(),new ModActivationMutation(),new AddGateMutation(),new SubGateMutation(),new AddSelfConnectionMutation(),new SubSelfConnectionMutation(),new AddBackConnectionMutation(),new SubBackConnectionMutation(),new SwapNodesMutation(),]

Const ALL_MUTATIONS

ALL_MUTATIONS: Mutation[] = ALL_INSTINCT_MUTATIONS

Const FEEDFORWARD_INSTINCT_MUTATIONS

FEEDFORWARD_INSTINCT_MUTATIONS: Mutation[] = [new AddNodeMutation(),new SubNodeMutation(),new AddConnectionMutation(),new SubConnectionMutation(),new ModWeightMutation(),new ModBiasMutation(),new ModActivationMutation(),new SwapNodesMutation(),]

Const FEEDFORWARD_MUTATIONS

FEEDFORWARD_MUTATIONS: Mutation[] = FEEDFORWARD_INSTINCT_MUTATIONS

Const NO_STRUCTURE_INSTINCT_MUTATIONS

NO_STRUCTURE_INSTINCT_MUTATIONS: Mutation[] = [new ModWeightMutation(),new ModBiasMutation(),new ModActivationMutation(),]

Const NO_STRUCTURE_MUTATIONS

NO_STRUCTURE_MUTATIONS: Mutation[] = NO_STRUCTURE_INSTINCT_MUTATIONS

Const ONLY_STRUCTURE_INSTINCT_MUTATION

ONLY_STRUCTURE_INSTINCT_MUTATION: Mutation[] = [new AddNodeMutation(),new SubNodeMutation(),new AddConnectionMutation(),new SubConnectionMutation(),new AddGateMutation(),new SubGateMutation(),new AddSelfConnectionMutation(),new SubSelfConnectionMutation(),new AddBackConnectionMutation(),new SubBackConnectionMutation(),new SwapNodesMutation(),]

Const ONLY_STRUCTURE_MUTATIONS

ONLY_STRUCTURE_MUTATIONS: Mutation[] = ONLY_STRUCTURE_INSTINCT_MUTATION

Functions

Const BinaryLoss

  • BinaryLoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const HINGELoss

  • HINGELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const MAELoss

  • MAELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const MAPELoss

  • MAPELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const MBELoss

  • MBELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const MSELoss

  • MSELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const MSLELoss

  • MSLELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

Const WAPELoss

  • WAPELoss(targets: number[], outputs: number[]): number
  • Parameters

    • targets: number[]
    • outputs: number[]

    Returns number

avg

  • avg(array: number[]): number
  • Calculates the average value of an array

    Parameters

    • array: number[]

    Returns number

generateGaussian

  • generateGaussian(mean?: number, deviation?: number): number

max

  • max(array: number[]): number
  • Finds the maximum value of an number array

    Parameters

    • array: number[]

    Returns number

maxValueIndex

  • maxValueIndex(array: number[]): number
  • Finds the maximum value index of an number array

    Parameters

    • array: number[]

    Returns number

min

  • min(array: number[]): number
  • Finds the minimum value of an number array

    Parameters

    • array: number[]

    Returns number

minValueIndex

  • minValueIndex(array: number[]): number
  • Finds the minimum value index of an number array

    Parameters

    • array: number[]

    Returns number

pairing

  • pairing(a: number, b: number): number

pickRandom

  • pickRandom<T>(arr: T[] | Set<T>): T
  • Returns an random element from the given array.

    Type parameters

    • T

    Parameters

    • arr: T[] | Set<T>

      the array to pick from

    Returns T

    the random picked element

randBoolean

  • randBoolean(): boolean
  • Returns a random boolean

    Returns boolean

    random boolean

randDouble

  • randDouble(min?: number, max?: number): number
  • Returns a random double in the range [min,max)

    Parameters

    • Default value min: number = 0

      bound

    • Default value max: number = 1

      bound

    Returns number

    random double in [min,max)

randInt

  • randInt(min: number, max: number): number
  • Returns a random integer in the range [min,max)

    Parameters

    • min: number

      bound

    • max: number

      bound

    Returns number

    random integer in [min,max)

removeFromArray

  • removeFromArray<T>(arr: T[], elem: T): boolean
  • Removes an element from an array.

    Type parameters

    • T

    Parameters

    • arr: T[]

      the array

    • elem: T

      the element which will be removed

    Returns boolean

    false -> element does not exists on array; true -> element removed from array

shuffle

  • shuffle<T>(array: T[]): void
  • Shuffles an array

    Type parameters

    • T

    Parameters

    • array: T[]

      the array

    Returns void

    the shuffled array

sum

  • sum(array: number[]): number
  • Calculates the sum of all values of an array

    Parameters

    • array: number[]

    Returns number

Object literals

Const ALL_LOSSES

ALL_LOSSES: object

BinaryLoss

BinaryLoss: lossType

HINGELoss

HINGELoss: lossType

MAELoss

MAELoss: lossType

MAPELoss

MAPELoss: lossType

MBELoss

MBELoss: lossType

MSELoss

MSELoss: lossType

MSLELoss

MSLELoss: lossType

WAPELoss

WAPELoss: lossType

Generated using TypeDoc