@@ -692,6 +692,178 @@ application_nasnetmobile <- function(input_shape = NULL, include_top = TRUE, wei
692692
693693}
694694
695+ # ' Instantiates the EfficientNetB0 architecture
696+ # '
697+ # ' @details
698+ # ' Reference:
699+ # ' - [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](
700+ # ' https://arxiv.org/abs/1905.11946) (ICML 2019)
701+ # '
702+ # ' This function returns a Keras image classification model,
703+ # ' optionally loaded with weights pre-trained on ImageNet.
704+ # '
705+ # ' For image classification use cases, see
706+ # ' [this page for detailed examples](
707+ # ' https://keras.io/api/applications/#usage-examples-for-image-classification-models).
708+ # '
709+ # ' For transfer learning use cases, make sure to read the
710+ # ' [guide to transfer learning & fine-tuning](
711+ # ' https://keras.io/guides/transfer_learning/).
712+ # '
713+ # ' EfficientNet models expect their inputs to be float tensors of pixels with values in the [0-255] range.
714+ # '
715+ # ' @note
716+ # ' Each Keras Application typically expects a specific kind of input preprocessing.
717+ # ' For EfficientNet, input preprocessing is included as part of the model
718+ # ' (as a `Rescaling` layer), and thus a calling a preprocessing function is not necessary.
719+ # '
720+ # '
721+ # ' @param include_top Whether to include the fully-connected
722+ # ' layer at the top of the network. Defaults to TRUE.
723+ # '
724+ # ' @param weights One of `NULL` (random initialization),
725+ # ' `'imagenet'` (pre-training on ImageNet),
726+ # ' or the path to the weights file to be loaded. Defaults to `'imagenet'`.
727+ # '
728+ # ' @param input_tensor Optional Keras tensor
729+ # ' (i.e. output of `layer_input()`)
730+ # ' to use as image input for the model.
731+ # '
732+ # ' @param input_shape Optional shape list, only to be specified
733+ # ' if `include_top` is FALSE.
734+ # ' It should have exactly 3 inputs channels.
735+ # '
736+ # ' @param pooling Optional pooling mode for feature extraction
737+ # ' when `include_top` is `FALSE`. Defaults to `NULL`.
738+ # ' - `NULL` means that the output of the model will be
739+ # ' the 4D tensor output of the
740+ # ' last convolutional layer.
741+ # ' - `'avg'` means that global average pooling
742+ # ' will be applied to the output of the
743+ # ' last convolutional layer, and thus
744+ # ' the output of the model will be a 2D tensor.
745+ # ' - `'max'` means that global max pooling will
746+ # ' be applied.
747+ # '
748+ # ' @param classes Optional number of classes to classify images into, only to be
749+ # ' specified if `include_top` is TRUE, and if no `weights` argument is
750+ # ' specified. Defaults to 1000 (number of ImageNet classes).
751+ # '
752+ # ' @param classifier_activation A string or callable. The activation function to
753+ # ' use on the "top" layer. Ignored unless `include_top = TRUE`. Set
754+ # ' `classifier_activation = NULL` to return the logits of the "top" layer.
755+ # ' Defaults to `'softmax'`. When loading pretrained weights,
756+ # ' `classifier_activation` can only be `NULL` or `"softmax"`.
757+ # '
758+ # ' @param ... for forward compatibility.
759+ # '
760+ # ' @seealso
761+ # ' + <https://www.tensorflow.org/api_docs/python/tf/keras/applications/efficientnet/EfficientNetB0>
762+ # ' + <https://keras.io/api/applications/>
763+ # ' @export
764+ application_efficientnet_b0 <-
765+ function (include_top = TRUE , weights = " imagenet" ,
766+ input_tensor = NULL , input_shape = NULL ,
767+ pooling = NULL , classes = 1000L ,
768+ classifier_activation = " softmax" ,
769+ ... )
770+ {
771+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
772+ do.call(keras $ applications $ EfficientNetB0 , args )
773+ }
774+
775+ # ' @export
776+ # ' @rdname application_efficientnet_b0
777+ application_efficientnet_b1 <-
778+ function (include_top = TRUE , weights = " imagenet" ,
779+ input_tensor = NULL , input_shape = NULL ,
780+ pooling = NULL , classes = 1000L ,
781+ classifier_activation = " softmax" ,
782+ ... )
783+ {
784+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
785+ do.call(keras $ applications $ EfficientNetB1 , args )
786+ }
787+
788+ # ' @export
789+ # ' @rdname application_efficientnet_b0
790+ application_efficientnet_b2 <-
791+ function (include_top = TRUE , weights = " imagenet" ,
792+ input_tensor = NULL , input_shape = NULL ,
793+ pooling = NULL , classes = 1000L ,
794+ classifier_activation = " softmax" ,
795+ ... )
796+ {
797+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
798+ do.call(keras $ applications $ EfficientNetB2 , args )
799+ }
800+
801+ # ' @export
802+ # ' @rdname application_efficientnet_b0
803+ application_efficientnet_b3 <-
804+ function (include_top = TRUE , weights = " imagenet" ,
805+ input_tensor = NULL , input_shape = NULL ,
806+ pooling = NULL , classes = 1000L ,
807+ classifier_activation = " softmax" ,
808+ ... )
809+ {
810+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
811+ do.call(keras $ applications $ EfficientNetB3 , args )
812+ }
813+
814+ # ' @export
815+ # ' @rdname application_efficientnet_b0
816+ application_efficientnet_b4 <-
817+ function (include_top = TRUE , weights = " imagenet" ,
818+ input_tensor = NULL , input_shape = NULL ,
819+ pooling = NULL , classes = 1000L ,
820+ classifier_activation = " softmax" ,
821+ ... )
822+ {
823+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
824+ do.call(keras $ applications $ EfficientNetB4 , args )
825+ }
826+
827+ # ' @export
828+ # ' @rdname application_efficientnet_b0
829+ application_efficientnet_b5 <-
830+ function (include_top = TRUE , weights = " imagenet" ,
831+ input_tensor = NULL , input_shape = NULL ,
832+ pooling = NULL , classes = 1000L ,
833+ classifier_activation = " softmax" ,
834+ ... )
835+ {
836+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
837+ do.call(keras $ applications $ EfficientNetB5 , args )
838+ }
839+
840+ # ' @export
841+ # ' @rdname application_efficientnet_b0
842+ application_efficientnet_b6 <-
843+ function (include_top = TRUE , weights = " imagenet" ,
844+ input_tensor = NULL , input_shape = NULL ,
845+ pooling = NULL , classes = 1000L ,
846+ classifier_activation = " softmax" ,
847+ ... )
848+ {
849+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
850+ do.call(keras $ applications $ EfficientNetB6 , args )
851+ }
852+
853+ # ' @export
854+ # ' @rdname application_efficientnet_b0
855+ application_efficientnet_b7 <-
856+ function (include_top = TRUE , weights = " imagenet" ,
857+ input_tensor = NULL , input_shape = NULL ,
858+ pooling = NULL , classes = 1000L ,
859+ classifier_activation = " softmax" ,
860+ ... )
861+ {
862+ args <- capture_args(match.call(), list (classes = as.integer , input_shape = normalize_shape ))
863+ do.call(keras $ applications $ EfficientNetB7 , args )
864+ }
865+
866+
695867# ' @rdname application_nasnet
696868# ' @export
697869nasnet_preprocess_input <- function (x ) {
0 commit comments