Skip to content

Files

Latest commit

May 31, 2024
3305bab · May 31, 2024

History

History

custom-layer

TensorFlow.js Example: Custom Layer

This example demonstrates how to write a custom layer for tfjs-layers.

We build a custom activation layer called 'Antirectifier' which outputs two channels for each input, one with just the positive signal, and one with just the negative signal. The example shows exercises the call and computeOutputShape overrides of the Layer.

See this example live!