smash.factory.Net.add_scale#
- Net.add_scale(bounds)[source]#
Add a scaling layer that applies the min-max scaling function to the outputs.
- Parameters:
- boundsListLike
A sequence of
(min, max)values that the outputs will be scaled to.
Examples
>>> from smash.factory import Net >>> net = Net() >>> net.add_dense(2, input_shape=8, activation="sigmoid") >>> net.add_scale([(2,3), (5,6)]) >>> net +----------------------------------------------------------+ | Layer Type Input/Output Shape Num Parameters | +----------------------------------------------------------+ | Dense (8,)/(2,) 18 | | Activation (Sigmoid) (2,)/(2,) 0 | | Scale (MinMaxScale) (2,)/(2,) 0 | +----------------------------------------------------------+ Total parameters: 18 Trainable parameters: 18