From 02c0a97ffaf514e5fae8a2e531deb885295fb460 Mon Sep 17 00:00:00 2001 From: Viktor Mukhachev <39690846+vmukhachev@users.noreply.github.com> Date: Mon, 16 Jun 2025 11:36:51 +0200 Subject: [PATCH 1/2] fix getConfig of DepthwiseConv2D for depthwiseConstraint --- tfjs-layers/src/layers/convolutional_depthwise.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-layers/src/layers/convolutional_depthwise.ts b/tfjs-layers/src/layers/convolutional_depthwise.ts index ea27eebdacd..ac6bb7e19e2 100644 --- a/tfjs-layers/src/layers/convolutional_depthwise.ts +++ b/tfjs-layers/src/layers/convolutional_depthwise.ts @@ -204,7 +204,7 @@ export class DepthwiseConv2D extends BaseConv { config['depthwiseRegularizer'] = serializeRegularizer(this.depthwiseRegularizer); config['depthwiseConstraint'] = - serializeConstraint(this.depthwiseRegularizer); + serializeConstraint(this.depthwiseConstraint); return config; } } From 7f817ebdb5200ec06098e58c9d74fe10de51deb8 Mon Sep 17 00:00:00 2001 From: Viktor Mukhachev <39690846+vmukhachev@users.noreply.github.com> Date: Thu, 26 Jun 2025 15:58:00 +0200 Subject: [PATCH 2/2] fix pointwiseInitializer arg usage for separableConv2d --- tfjs-layers/src/layers/convolutional.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-layers/src/layers/convolutional.ts b/tfjs-layers/src/layers/convolutional.ts index 5207c1f88c4..a4cb0d5e0c1 100644 --- a/tfjs-layers/src/layers/convolutional.ts +++ b/tfjs-layers/src/layers/convolutional.ts @@ -1102,7 +1102,7 @@ export class SeparableConv extends Conv { this.depthwiseRegularizer = getRegularizer(config.depthwiseRegularizer); this.depthwiseConstraint = getConstraint(config.depthwiseConstraint); this.pointwiseInitializer = getInitializer( - config.depthwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); + config.pointwiseInitializer || this.DEFAULT_POINTWISE_INITIALIZER); this.pointwiseRegularizer = getRegularizer(config.pointwiseRegularizer); this.pointwiseConstraint = getConstraint(config.pointwiseConstraint); }