Skip to content

Add tests #35

@kwinkunks

Description

@kwinkunks

Probably using jest.

Not too bothered about testing the entire application, but it would be smart to at least test the NN functions:

export let activations: {[key: string]: nn.ActivationFunction} = {
  "relu": nn.Activations.RELU,
  "leakyrelu": nn.Activations.LeakyRELU,
  "elu": nn.Activations.ELU,
  "tanh": nn.Activations.TANH,
  "sigmoid": nn.Activations.SIGMOID,
  "swish": nn.Activations.SWISH,
  "mish": nn.Activations.MISH,
  "softplus": nn.Activations.SOFTPLUS,
  "gelu": nn.Activations.GELU,
  "linear": nn.Activations.LINEAR,
  "bent": nn.Activations.BENT_IDENTITY
};

/** A map between names and regularization functions. */
export let regularizations: {[key: string]: nn.RegularizationFunction} = {
  "none": null,
  "L1": nn.Regularizations.L1,
  "L2": nn.Regularizations.L2,
  "elastic net": nn.Regularizations.ElasticNet,
  "huber": nn.Regularizations.Huber
};

/** A map between names and eval functions. */
export let evals: {[key: string]: nn.EvalFunction} = {
  "f1": nn.Evals.F1,
  "mcc": nn.Evals.MATTHEWS_CORR_COEFF,
  "r2": nn.Evals.R2,
  "rmse": nn.Evals.RMSE
};

/** A map between names and loss functions. */
export let errors: {[key: string]: nn.ErrorFunction} = {
  "square": nn.Errors.SQUARE,
  "absolute": nn.Errors.ABS,
  "hinge": nn.Errors.HINGE,
  "squared hinge": nn.Errors.SQUARED_HINGE,
  "huber": nn.Errors.HUBER,
  "modified huber": nn.Errors.MODIFIED_HUBER,
  "cross entropy": nn.Errors.BINARY_CROSS_ENTROPY,
  "exponential": nn.Errors.EXPONENTIAL,
  "poisson": nn.Errors.POISSON,
  "epsilon insensitive": nn.Errors.EPSILON_INSENSITIVE
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersmaintenanceImprovements to the code or deployment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions