summaryrefslogtreecommitdiff
path: root/candle-wasm-examples
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-08-29 16:12:11 +0100
committerGitHub <noreply@github.com>2023-08-29 16:12:11 +0100
commita044907ffce553a0394db3a1204f21e3691e54af (patch)
tree8ce11fae8ee11e4eb181f7240344994356625791 /candle-wasm-examples
parentee8bb1bde1a44738c314dfaacba743f4eabf917c (diff)
downloadcandle-a044907ffce553a0394db3a1204f21e3691e54af.tar.gz
candle-a044907ffce553a0394db3a1204f21e3691e54af.tar.bz2
candle-a044907ffce553a0394db3a1204f21e3691e54af.zip
Dilated convolutions (#657)
* Add the dilation parameter. * Restore the basic optimizer example. * Dilation support in cudnn. * Use the dilation parameter in the cpu backend. * More dilation support. * No support for dilation in transposed convolutions. * Add dilation to a test. * Remove a print. * Helper function.
Diffstat (limited to 'candle-wasm-examples')
-rw-r--r--candle-wasm-examples/whisper/src/model.rs2
-rw-r--r--candle-wasm-examples/yolo/src/model.rs1
2 files changed, 3 insertions, 0 deletions
diff --git a/candle-wasm-examples/whisper/src/model.rs b/candle-wasm-examples/whisper/src/model.rs
index 72dbdcdd..239ceee5 100644
--- a/candle-wasm-examples/whisper/src/model.rs
+++ b/candle-wasm-examples/whisper/src/model.rs
@@ -269,11 +269,13 @@ impl AudioEncoder {
padding: 1,
stride: 1,
groups: 1,
+ dilation: 1,
};
let cfg2 = Conv1dConfig {
padding: 1,
stride: 2,
groups: 1,
+ dilation: 1,
};
let conv1 = conv1d(cfg.num_mel_bins, n_state, 3, cfg1, vb.pp("conv1"))?;
let conv2 = conv1d(n_state, n_state, 3, cfg2, vb.pp("conv2"))?;
diff --git a/candle-wasm-examples/yolo/src/model.rs b/candle-wasm-examples/yolo/src/model.rs
index a63c6e94..e0fa7ac4 100644
--- a/candle-wasm-examples/yolo/src/model.rs
+++ b/candle-wasm-examples/yolo/src/model.rs
@@ -97,6 +97,7 @@ impl ConvBlock {
padding,
stride,
groups: 1,
+ dilation: 1,
};
let conv = conv2d_no_bias(c1, c2, k, cfg, vb.pp("conv"))?;
let bn = batch_norm(c2, 1e-3, vb.pp("bn"))?;