@@ -279,18 +279,18 @@ function inceptionv4_c()
279
279
end
280
280
281
281
"""
282
- inceptionv4(; inchannels = 3, dropout = 0.0, nclasses = 1000)
282
+ inceptionv4(; inchannels = 3, drop_rate = 0.0, nclasses = 1000)
283
283
284
284
Create an Inceptionv4 model.
285
285
([reference](https://arxiv.org/abs/1602.07261))
286
286
287
287
# Arguments
288
288
289
289
- `inchannels`: number of input channels.
290
- - `dropout `: rate of dropout in classifier head.
290
+ - `drop_rate `: rate of dropout in classifier head.
291
291
- `nclasses`: the number of output classes.
292
292
"""
293
- function inceptionv4 (; inchannels = 3 , dropout = 0.0 , nclasses = 1000 )
293
+ function inceptionv4 (; inchannels = 3 , drop_rate = 0.0 , nclasses = 1000 )
294
294
body = Chain (conv_bn ((3 , 3 ), inchannels, 32 ; stride = 2 )... ,
295
295
conv_bn ((3 , 3 ), 32 , 32 )... ,
296
296
conv_bn ((3 , 3 ), 32 , 64 ; pad = 1 )... ,
@@ -313,12 +313,13 @@ function inceptionv4(; inchannels = 3, dropout = 0.0, nclasses = 1000)
313
313
inceptionv4_c (),
314
314
inceptionv4_c (),
315
315
inceptionv4_c ())
316
- head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (dropout), Dense (1536 , nclasses))
316
+ head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (drop_rate),
317
+ Dense (1536 , nclasses))
317
318
return Chain (body, head)
318
319
end
319
320
320
321
"""
321
- Inceptionv4(; pretrain = false, inchannels = 3, dropout = 0.0, nclasses = 1000)
322
+ Inceptionv4(; pretrain = false, inchannels = 3, drop_rate = 0.0, nclasses = 1000)
322
323
323
324
Creates an Inceptionv4 model.
324
325
([reference](https://arxiv.org/abs/1602.07261))
@@ -327,7 +328,7 @@ Creates an Inceptionv4 model.
327
328
328
329
- `pretrain`: set to `true` to load the pre-trained weights for ImageNet
329
330
- `inchannels`: number of input channels.
330
- - `dropout `: rate of dropout in classifier head.
331
+ - `drop_rate `: rate of dropout in classifier head.
331
332
- `nclasses`: the number of output classes.
332
333
333
334
!!! warning
@@ -338,7 +339,7 @@ struct Inceptionv4
338
339
layers:: Any
339
340
end
340
341
341
- function Inceptionv4 (; pretrain = false , inchannels = 3 , dropout = 0.0 , nclasses = 1000 )
342
+ function Inceptionv4 (; pretrain = false , inchannels = 3 , drop_rate = 0.0 , nclasses = 1000 )
342
343
layers = inceptionv4 (; inchannels, dropout, nclasses)
343
344
pretrain && loadpretrain! (layers, " Inceptionv4" )
344
345
return Inceptionv4 (layers)
@@ -419,18 +420,18 @@ function block8(scale = 1.0f0; activation = identity)
419
420
end
420
421
421
422
"""
422
- inceptionresnetv2(; inchannels = 3, dropout = 0.0, nclasses = 1000)
423
+ inceptionresnetv2(; inchannels = 3, drop_rate = 0.0, nclasses = 1000)
423
424
424
425
Creates an InceptionResNetv2 model.
425
426
([reference](https://arxiv.org/abs/1602.07261))
426
427
427
428
# Arguments
428
429
429
430
- `inchannels`: number of input channels.
430
- - `dropout `: rate of dropout in classifier head.
431
+ - `drop_rate `: rate of dropout in classifier head.
431
432
- `nclasses`: the number of output classes.
432
433
"""
433
- function inceptionresnetv2 (; inchannels = 3 , dropout = 0.0 , nclasses = 1000 )
434
+ function inceptionresnetv2 (; inchannels = 3 , drop_rate = 0.0 , nclasses = 1000 )
434
435
body = Chain (conv_bn ((3 , 3 ), inchannels, 32 ; stride = 2 )... ,
435
436
conv_bn ((3 , 3 ), 32 , 32 )... ,
436
437
conv_bn ((3 , 3 ), 32 , 64 ; pad = 1 )... ,
@@ -446,12 +447,13 @@ function inceptionresnetv2(; inchannels = 3, dropout = 0.0, nclasses = 1000)
446
447
[block8 (0.20f0 ) for _ in 1 : 9 ]. .. ,
447
448
block8 (; activation = relu),
448
449
conv_bn ((1 , 1 ), 2080 , 1536 )... )
449
- head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (dropout), Dense (1536 , nclasses))
450
+ head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (drop_rate),
451
+ Dense (1536 , nclasses))
450
452
return Chain (body, head)
451
453
end
452
454
453
455
"""
454
- InceptionResNetv2(; pretrain = false, inchannels = 3, dropout = 0.0, nclasses = 1000)
456
+ InceptionResNetv2(; pretrain = false, inchannels = 3, drop_rate = 0.0, nclasses = 1000)
455
457
456
458
Creates an InceptionResNetv2 model.
457
459
([reference](https://arxiv.org/abs/1602.07261))
@@ -460,7 +462,7 @@ Creates an InceptionResNetv2 model.
460
462
461
463
- `pretrain`: set to `true` to load the pre-trained weights for ImageNet
462
464
- `inchannels`: number of input channels.
463
- - `dropout `: rate of dropout in classifier head.
465
+ - `drop_rate `: rate of dropout in classifier head.
464
466
- `nclasses`: the number of output classes.
465
467
466
468
!!! warning
@@ -471,9 +473,9 @@ struct InceptionResNetv2
471
473
layers:: Any
472
474
end
473
475
474
- function InceptionResNetv2 (; pretrain = false , inchannels = 3 , dropout = 0.0 ,
476
+ function InceptionResNetv2 (; pretrain = false , inchannels = 3 , drop_rate = 0.0 ,
475
477
nclasses = 1000 )
476
- layers = inceptionresnetv2 (; inchannels, dropout , nclasses)
478
+ layers = inceptionresnetv2 (; inchannels, drop_rate , nclasses)
477
479
pretrain && loadpretrain! (layers, " InceptionResNetv2" )
478
480
return InceptionResNetv2 (layers)
479
481
end
@@ -533,18 +535,18 @@ function xception_block(inchannels, outchannels, nrepeats; stride = 1,
533
535
end
534
536
535
537
"""
536
- xception(; inchannels = 3, dropout = 0.0, nclasses = 1000)
538
+ xception(; inchannels = 3, drop_rate = 0.0, nclasses = 1000)
537
539
538
540
Creates an Xception model.
539
541
([reference](https://arxiv.org/abs/1610.02357))
540
542
541
543
# Arguments
542
544
543
545
- `inchannels`: number of input channels.
544
- - `dropout `: rate of dropout in classifier head.
546
+ - `drop_rate `: rate of dropout in classifier head.
545
547
- `nclasses`: the number of output classes.
546
548
"""
547
- function xception (; inchannels = 3 , dropout = 0.0 , nclasses = 1000 )
549
+ function xception (; inchannels = 3 , drop_rate = 0.0 , nclasses = 1000 )
548
550
body = Chain (conv_bn ((3 , 3 ), inchannels, 32 ; stride = 2 , bias = false )... ,
549
551
conv_bn ((3 , 3 ), 32 , 64 ; bias = false )... ,
550
552
xception_block (64 , 128 , 2 ; stride = 2 , start_with_relu = false ),
@@ -554,7 +556,8 @@ function xception(; inchannels = 3, dropout = 0.0, nclasses = 1000)
554
556
xception_block (728 , 1024 , 2 ; stride = 2 , grow_at_start = false ),
555
557
depthwise_sep_conv_bn ((3 , 3 ), 1024 , 1536 ; pad = 1 )... ,
556
558
depthwise_sep_conv_bn ((3 , 3 ), 1536 , 2048 ; pad = 1 )... )
557
- head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (dropout), Dense (2048 , nclasses))
559
+ head = Chain (GlobalMeanPool (), MLUtils. flatten, Dropout (drop_rate),
560
+ Dense (2048 , nclasses))
558
561
return Chain (body, head)
559
562
end
560
563
@@ -563,7 +566,7 @@ struct Xception
563
566
end
564
567
565
568
"""
566
- Xception(; pretrain = false, inchannels = 3, dropout = 0.0, nclasses = 1000)
569
+ Xception(; pretrain = false, inchannels = 3, drop_rate = 0.0, nclasses = 1000)
567
570
568
571
Creates an Xception model.
569
572
([reference](https://arxiv.org/abs/1610.02357))
@@ -572,15 +575,15 @@ Creates an Xception model.
572
575
573
576
- `pretrain`: set to `true` to load the pre-trained weights for ImageNet.
574
577
- `inchannels`: number of input channels.
575
- - `dropout `: rate of dropout in classifier head.
578
+ - `drop_rate `: rate of dropout in classifier head.
576
579
- `nclasses`: the number of output classes.
577
580
578
581
!!! warning
579
582
580
583
`Xception` does not currently support pretrained weights.
581
584
"""
582
- function Xception (; pretrain = false , inchannels = 3 , dropout = 0.0 , nclasses = 1000 )
583
- layers = xception (; inchannels, dropout , nclasses)
585
+ function Xception (; pretrain = false , inchannels = 3 , drop_rate = 0.0 , nclasses = 1000 )
586
+ layers = xception (; inchannels, drop_rate , nclasses)
584
587
pretrain && loadpretrain! (layers, " xception" )
585
588
return Xception (layers)
586
589
end
0 commit comments