Home Reference Source

References

summary
public
public
public

C Vol

Store a 3D volume of numbers with width(sx), height(sy), depth(depth) for the network.

public

F augment(volume: Vol, crop: number, dx: number, dy: number, flip: number): Vol

Data augmentation to the given volume based on crop.

public

F img_to_vol(img: HTMLImageElement, grayScale: boolean): Vol

Load an HTML DOM image to a virtual canvas and get the pixles data.

public

F arrContains(array: Array, element: undefined): boolean

Check if an element exists in given array or not

public

F arrUnique(array: Array): Array

Creates a duplicate-free version of an array

public

F assert(condition: boolean, message: undefined)

Check the given condition, if false, throw exception with the given message

public
public

F getopt(dict: Array, key: undefined, defaultValue: undefined): *

Return the given dict value by key.

public

F maxmin(values: undefined): {"maxi": *, "maxv": *, "mini": *, "minv": *, "dv": *}

Return the max/min information of a given value list.

public

F randf(a: number, b: number): number

Return a random float number between a and b

public

F randi(a: number, b: number): number

Return a random integer number between a and b

public

F randn(mean: number, std: number): number

Return a random number based on the given mean and standard deviation by following Gaussian distribution

public

Generate a incrementing number list between 0 and n, shffle the list and return it as the result

public

F range(n: number): *

Return a zero based number list by given size n

public

F weightedSample(array: Array, probabilities: Array): *

Return a sample of the given array by given probabilities

public

Return a series of 0

public