@@ -292,7 +292,7 @@ function resnet(img_dims, stem, get_layers, block_repeats::AbstractVector{<:Inte
292
292
return Chain (backbone, classifier_fn (nfeaturemaps))
293
293
end
294
294
295
- function resnet (block_type:: Symbol , block_repeats:: AbstractVector{<:Integer} ,
295
+ function resnet (block_type, block_repeats:: AbstractVector{<:Integer} ,
296
296
downsample_opt:: NTuple{2, Any} = (downsample_conv, downsample_identity);
297
297
cardinality:: Integer = 1 , base_width:: Integer = 64 , inplanes:: Integer = 64 ,
298
298
reduction_factor:: Integer = 1 , imsize:: Dims{2} = (256 , 256 ),
@@ -304,7 +304,7 @@ function resnet(block_type::Symbol, block_repeats::AbstractVector{<:Integer},
304
304
# Build stem
305
305
stem = stem_fn (; inchannels)
306
306
# Block builder
307
- if block_type === : basicblock
307
+ if block_type == basicblock
308
308
@assert cardinality== 1 " Cardinality must be 1 for `basicblock`"
309
309
@assert base_width== 64 " Base width must be 64 for `basicblock`"
310
310
get_layers = basicblock_builder (block_repeats; inplanes, reduction_factor,
@@ -314,15 +314,15 @@ function resnet(block_type::Symbol, block_repeats::AbstractVector{<:Integer},
314
314
planes_fn = resnet_planes,
315
315
downsample_tuple = downsample_opt,
316
316
kwargs... )
317
- elseif block_type === : bottleneck
317
+ elseif block_type == bottleneck
318
318
get_layers = bottleneck_builder (block_repeats; inplanes, cardinality, base_width,
319
319
reduction_factor, activation, norm_layer, revnorm,
320
320
attn_fn, drop_block_rate, drop_path_rate,
321
321
stride_fn = resnet_stride,
322
322
planes_fn = resnet_planes,
323
323
downsample_tuple = downsample_opt,
324
324
kwargs... )
325
- elseif block_type === : bottle2neck
325
+ elseif block_type == bottle2neck
326
326
@assert drop_block_rate== 0.0 " DropBlock not supported for `bottle2neck`"
327
327
@assert drop_path_rate== 0.0 " DropPath not supported for `bottle2neck`"
328
328
@assert reduction_factor== 1 " Reduction factor not supported for `bottle2neck`"
@@ -346,12 +346,12 @@ function resnet(block_fn, block_repeats, downsample_opt::Symbol = :B; kwargs...)
346
346
end
347
347
348
348
# block-layer configurations for ResNet-like models
349
- const RESNET_CONFIGS = Dict (18 => (: basicblock , [2 , 2 , 2 , 2 ]),
350
- 34 => (: basicblock , [3 , 4 , 6 , 3 ]),
351
- 50 => (: bottleneck , [3 , 4 , 6 , 3 ]),
352
- 101 => (: bottleneck , [3 , 4 , 23 , 3 ]),
353
- 152 => (: bottleneck , [3 , 8 , 36 , 3 ]))
349
+ const RESNET_CONFIGS = Dict (18 => (basicblock, [2 , 2 , 2 , 2 ]),
350
+ 34 => (basicblock, [3 , 4 , 6 , 3 ]),
351
+ 50 => (bottleneck, [3 , 4 , 6 , 3 ]),
352
+ 101 => (bottleneck, [3 , 4 , 23 , 3 ]),
353
+ 152 => (bottleneck, [3 , 8 , 36 , 3 ]))
354
354
355
- const LRESNET_CONFIGS = Dict (50 => (: bottleneck , [3 , 4 , 6 , 3 ]),
356
- 101 => (: bottleneck , [3 , 4 , 23 , 3 ]),
357
- 152 => (: bottleneck , [3 , 8 , 36 , 3 ]))
355
+ const LRESNET_CONFIGS = Dict (50 => (bottleneck, [3 , 4 , 6 , 3 ]),
356
+ 101 => (bottleneck, [3 , 4 , 23 , 3 ]),
357
+ 152 => (bottleneck, [3 , 8 , 36 , 3 ]))
0 commit comments