Skip to content

Commit 974b431

Browse files
committed
Add generic constructor
Add a parameterized constructor for creating any of the EfficientNet variants, i.e. from EfficientNetB0 to EfficientNetB7.
1 parent 8aa3fa5 commit 974b431

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

efficientnet/model.py

+15
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
__all__ = [
4444
"EfficientNet",
45+
"EfficientNetBn",
4546
"EfficientNetB0",
4647
"EfficientNetB1",
4748
"EfficientNetB2",
@@ -388,6 +389,20 @@ def _get_model_by_name(
388389
return model
389390

390391

392+
def EfficientNetBn(
393+
n, include_top=True, input_shape=None, input_tensor=None, weights=None, classes=1000, pooling=None
394+
):
395+
return _get_model_by_name(
396+
"efficientnet-b{}".format(n),
397+
include_top=include_top,
398+
input_shape=input_shape,
399+
input_tensor=input_tensor,
400+
weights=weights,
401+
classes=classes,
402+
pooling=pooling,
403+
)
404+
405+
391406
def EfficientNetB0(
392407
include_top=True, input_shape=None, input_tensor=None, weights=None, classes=1000, pooling=None
393408
):

0 commit comments

Comments
 (0)