CNN Model Helpers (API) #
Small config-style CNN constructors for runnable examples.
Height after the convolution stage.
Instances For
Width after the convolution stage.
Instances For
Height after the pooling stage.
Instances For
Width after the pooling stage.
Instances For
Flattened feature size entering the classifier head.
Instances For
def
NN.API.nn.models.cnn
(cfg : CnnConfig)
(h_inC : cfg.inC ≠ 0 := by decide)
(h_kH : cfg.conv.kH ≠ 0 := by decide)
(h_kW : cfg.conv.kW ≠ 0 := by decide)
(h_poolKH : cfg.pool.kH ≠ 0 := by decide)
(h_poolKW : cfg.pool.kW ≠ 0 := by decide)
:
M (Sequential (cnnInShape cfg) (cnnOutShape cfg))
Build a compact CNN classifier:
conv -> relu -> maxPool -> flatten -> linear.