import * as neataptic from "neataptic" export const costFnName = [ "CROSS_ENTROPY", "MSE", "BINARY", "MAE", "MAPE", "MSLE", "HINGE", ] as const export type CostFnName = typeof costFnName[number] export type CostFn = (target: number[], output: number[]) => number export const CROSS_ENTROPY: CostFn = neataptic.methods.cost.CROSS_ENTROPY export const MSE: CostFn = neataptic.methods.cost.MSE export const BINARY: CostFn = neataptic.methods.cost.BINARY export const MAE: CostFn = neataptic.methods.cost.MAE export const MAPE: CostFn = neataptic.methods.cost.MAPE export const MSLE: CostFn = neataptic.methods.cost.MSLE export const HINGE: CostFn = neataptic.methods.cost.HINGE export function getCostFn(name: CostFnName): CostFn { return neataptic.methods.cost[name] }