Skip to content

Add Conv3D layer support - #455

Merged
Dobiasd merged 1 commit into
masterfrom
conv-3d
Apr 27, 2026
Merged

Add Conv3D layer support#455
Dobiasd merged 1 commit into
masterfrom
conv-3d

Conversation

@Dobiasd

@Dobiasd Dobiasd commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implements Conv3D (closes Conv3D #137) using the same im2col + Eigen GEMM strategy as Conv2D, extended with two outer filter-offset loops for the d4 axis
  • Supports valid, same, and causal padding, arbitrary strides and dilation rates
  • New C++ files: include/fdeep/convolution3d.hpp (math), include/fdeep/layers/conv_3d_layer.hpp (layer wrapper)
  • Wires up Conv3D in the JSON dispatch (import_model.hpp) and the Python exporter (convert_model.py)
  • Adds Conv3D test cases to generate_test_models.py covering basic / strides+same / dilation+same / no-bias variants

Test plan

  • Standalone C++ correctness against a brute-force reference: max diff ~1e-6 across valid/same, strides 1×1×1 / 2×2×2 / 2×2×3 / 1×2×1, and f_d4=1 edge case
  • End-to-end Keras → fdeep round-trip: a multi-output Keras model with the four Conv3D variants (basic, strides+same, dilation+same, no-bias) loads and predicts in fdeep with embedded-test diff ~5e-6 vs Keras
  • Existing Conv2D unchanged: round-trip diff ~2e-6 in the same multi-input model
  • CI runs test_model_exhaustive_test against the updated generate_test_models.py

Out of scope (separate follow-ups)

  • Conv3DTranspose, SeparableConv3D, DepthwiseConv3D
  • Stride-1 fast path for 3D conv (analogous to convolve_accumulative_s1x1 in 2D)
  • UpSampling3D

🤖 Generated with Claude Code

Implements the Conv3D layer using the same im2col + Eigen GEMM strategy
as Conv2D, with two outer filter-offset loops for the d4 axis. Supports
valid/same/causal padding, strides, and dilation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Dobiasd
Dobiasd merged commit ecfa571 into master Apr 27, 2026
4 checks passed
@Dobiasd
Dobiasd deleted the conv-3d branch April 27, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conv3D

1 participant