diff --git a/index.html b/index.html index 3f6060d6..f4896cb9 100644 --- a/index.html +++ b/index.html @@ -98,6 +98,7 @@

Tinker With a Neural Network R + diff --git a/src/nn.ts b/src/nn.ts index e92a13de..4e919491 100644 --- a/src/nn.ts +++ b/src/nn.ts @@ -134,6 +134,10 @@ export class Activations { output: x => x, der: x => 1 }; + public static SINE: ActivationFunction = { + output: x => (Math as any).sin(x), + der: x => (Math as any).cos(x) + }; } /** Build-in regularization functions */ diff --git a/src/state.ts b/src/state.ts index 42dc8154..bdb2ae69 100644 --- a/src/state.ts +++ b/src/state.ts @@ -24,7 +24,8 @@ export let activations: {[key: string]: nn.ActivationFunction} = { "relu": nn.Activations.RELU, "tanh": nn.Activations.TANH, "sigmoid": nn.Activations.SIGMOID, - "linear": nn.Activations.LINEAR + "linear": nn.Activations.LINEAR, + "sine": nn.Activations.SINE }; /** A map between names and regularization functions. */