(rank: number, config?: SeparableConvLayerArgs)
| 1073 | protected pointwiseKernel: LayerVariable = null; |
| 1074 | |
| 1075 | constructor(rank: number, config?: SeparableConvLayerArgs) { |
| 1076 | super(rank, config); |
| 1077 | |
| 1078 | if (config.filters == null) { |
| 1079 | throw new ValueError( |
| 1080 | 'The `filters` configuration field is required by SeparableConv, ' + |
| 1081 | 'but is unspecified.'); |
| 1082 | } |
| 1083 | if (config.kernelInitializer != null || config.kernelRegularizer != null || |
| 1084 | config.kernelConstraint != null) { |
| 1085 | throw new ValueError( |
| 1086 | 'Fields kernelInitializer, kernelRegularizer and kernelConstraint ' + |
| 1087 | 'are invalid for SeparableConv2D. Use depthwiseInitializer, ' + |
| 1088 | 'depthwiseRegularizer, depthwiseConstraint, pointwiseInitializer, ' + |
| 1089 | 'pointwiseRegularizer and pointwiseConstraint instead.'); |
| 1090 | } |
| 1091 | if (config.padding != null && config.padding !== 'same' && |
| 1092 | config.padding !== 'valid') { |
| 1093 | throw new ValueError( |
| 1094 | `SeparableConv${this.rank}D supports only padding modes: ` + |
| 1095 | `'same' and 'valid', but received ${JSON.stringify(config.padding)}`); |
| 1096 | } |
| 1097 | |
| 1098 | this.depthMultiplier = |
| 1099 | config.depthMultiplier == null ? 1 : config.depthMultiplier; |
| 1100 | this.depthwiseInitializer = getInitializer( |
| 1101 | config.depthwiseInitializer || this.DEFAULT_DEPTHWISE_INITIALIZER); |
| 1102 | this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); |
| 1103 | this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); |
| 1104 | this.pointwiseInitializer = getInitializer( |
| 1105 | config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); |
| 1106 | this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); |
| 1107 | this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); |
| 1108 | } |
| 1109 | |
| 1110 | override build(inputShape: Shape|Shape[]): void { |
| 1111 | inputShape = getExactlyOneShape(inputShape); |
nothing calls this directly
no test coverage detected