Skip to content

[tfjs-layers] Add SigmoidRange layer #5548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion tfjs-layers/src/exports_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import {InputLayer, InputLayerArgs} from './engine/input_layer';
import {Layer, LayerArgs} from './engine/topology';
import {input} from './exports';
import {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs} from './layers/advanced_activations';
import {ELU, ELULayerArgs, LeakyReLU, LeakyReLULayerArgs, PReLU, PReLULayerArgs, ReLU, ReLULayerArgs, Softmax, SoftmaxLayerArgs, ThresholdedReLU, ThresholdedReLULayerArgs, SigmoidRange, SigmoidRangeLayerArgs} from './layers/advanced_activations';
import {Conv1D, Conv2D, Conv2DTranspose, Conv3D, ConvLayerArgs, Cropping2D, Cropping2DLayerArgs, SeparableConv2D, SeparableConvLayerArgs, UpSampling2D, UpSampling2DLayerArgs, Conv3DTranspose} from './layers/convolutional';
import {DepthwiseConv2D, DepthwiseConv2DLayerArgs} from './layers/convolutional_depthwise';
import {ConvLSTM2D, ConvLSTM2DArgs, ConvLSTM2DCell, ConvLSTM2DCellArgs} from './layers/convolutional_recurrent';
Expand Down Expand Up @@ -188,6 +188,28 @@ export function softmax(args?: SoftmaxLayerArgs) {
return new Softmax(args);
}

/**
* SigmoidRange layer.
* It follows
* `sigmoid(x) * (max - min) + min`
* the output of the layer will be between max and min
* Input shape:
* Arbitrary. Use the configuration `inputShape` when using this layer as the
* first layer in a model.
*
* Output shape:
* Same shape as the input.
*
* @doc {
* heading: 'Layers',
* subheading: 'Advanced Activation',
* namespace: 'layers'
* }
*/
export function sigmoidRange(args?: SigmoidRangeLayerArgs) {
return new SigmoidRange(args);
}

/**
* Thresholded Rectified Linear Unit.
*
Expand Down
Loading