MCPcopy Index your code
hub / github.com/tensorflow/tfjs / constructor

Method constructor

tfjs-layers/src/layers/normalization.ts:274–296  ·  view source on GitHub ↗
(args?: BatchNormalizationLayerArgs)

Source from the content-addressed store, hash-verified

272 private movingVariance: LayerVariable;
273
274 constructor(args?: BatchNormalizationLayerArgs) {
275 if (args == null) {
276 args = {};
277 }
278 super(args);
279
280 this.supportsMasking = true;
281 this.axis = args.axis == null ? -1 : args.axis;
282 this.momentum = args.momentum == null ? 0.99 : args.momentum;
283 this.epsilon = args.epsilon == null ? 1e-3 : args.epsilon;
284 this.center = args.center == null ? true : args.center;
285 this.scale = args.scale == null ? true : args.scale;
286 this.betaInitializer = getInitializer(args.betaInitializer || 'zeros');
287 this.gammaInitializer = getInitializer(args.gammaInitializer || 'ones');
288 this.movingMeanInitializer =
289 getInitializer(args.movingMeanInitializer || 'zeros');
290 this.movingVarianceInitializer =
291 getInitializer(args.movingVarianceInitializer || 'ones');
292 this.betaConstraint = getConstraint(args.betaConstraint);
293 this.gammaConstraint = getConstraint(args.gammaConstraint);
294 this.betaRegularizer = getRegularizer(args.betaRegularizer);
295 this.gammaRegularizer = getRegularizer(args.gammaRegularizer);
296 }
297
298 public override build(inputShape: Shape|Shape[]): void {
299 inputShape = getExactlyOneShape(inputShape);

Callers

nothing calls this directly

Calls 3

getInitializerFunction · 0.90
getConstraintFunction · 0.90
getRegularizerFunction · 0.90

Tested by

no test coverage detected