MCPcopy
hub / github.com/tensorflow/tfjs / getRegularizer

Function getRegularizer

tfjs-layers/src/regularizers.ts:132–149  ·  view source on GitHub ↗
(identifier: RegularizerIdentifier|
                               serialization.ConfigDict|
                               Regularizer)

Source from the content-addressed store, hash-verified

130}
131
132export function getRegularizer(identifier: RegularizerIdentifier|
133 serialization.ConfigDict|
134 Regularizer): Regularizer {
135 if (identifier == null) {
136 return null;
137 }
138 if (typeof identifier === 'string') {
139 const className = identifier in REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP ?
140 REGULARIZER_IDENTIFIER_REGISTRY_SYMBOL_MAP[identifier] :
141 identifier;
142 const config = {className, config: {}};
143 return deserializeRegularizer(config);
144 } else if (identifier instanceof Regularizer) {
145 return identifier;
146 } else {
147 return deserializeRegularizer(identifier);
148 }
149}

Callers 14

constructorFunction · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90
constructorMethod · 0.90

Calls 1

deserializeRegularizerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…