import{S as jn,i as zn,s as Pn,e as a,k as p,w as y,t as i,M as Zn,c as s,d as o,m as h,a as r,x as E,h as c,b as l,G as t,g as _,y as w,q as N,o as $,B as M,v as kn,L as qo}from"../../chunks/vendor-hf-doc-builder.js";import{T as xn}from"../../chunks/Tip-hf-doc-builder.js";import{D as Ce}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Qo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Be}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Go}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Un(C){let d,v,u,m,b;return m=new Qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVmZmljaWVudE5ldENvbmZpZyUyQyUyMEVmZmljaWVudE5ldE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEVmZmljaWVudE5ldCUyMGVmZmljaWVudG5ldC1iNyUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBFZmZpY2llbnROZXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZWZmaWNpZW50bmV0LWI3JTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnROZXRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> EfficientNetConfig, EfficientNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a EfficientNet efficientnet-b7 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = EfficientNetConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the efficientnet-b7 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientNetModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){d=a("p"),v=i("Example:"),u=p(),y(m.$$.fragment)},l(n){d=s(n,"P",{});var g=r(d);v=c(g,"Example:"),g.forEach(o),u=h(n),E(m.$$.fragment,n)},m(n,g){_(n,d,g),t(d,v),_(n,u,g),w(m,n,g),b=!0},p:qo,i(n){b||(N(m.$$.fragment,n),b=!0)},o(n){$(m.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(u),M(m,n)}}}function Wn(C){let d,v,u,m,b;return{c(){d=a("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=s(n,"P",{});var g=r(d);v=c(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(g,"CODE",{});var z=r(u);m=c(z,"Module"),z.forEach(o),b=c(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(n,g){_(n,d,g),t(d,v),t(d,u),t(u,m),t(d,b)},d(n){n&&o(d)}}}function Fn(C){let d,v,u,m,b;return m=new Qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudE5ldE1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJnb29nbGUlMkZlZmZpY2llbnRuZXQtYjclMjIpJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnROZXRNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyZ29vZ2xlJTJGZWZmaWNpZW50bmV0LWI3JTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;google/efficientnet-b7&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientNetModel.from_pretrained(<span class="hljs-string">&quot;google/efficientnet-b7&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">768</span>, <span class="hljs-number">7</span>, <span class="hljs-number">7</span>]`}}),{c(){d=a("p"),v=i("Example:"),u=p(),y(m.$$.fragment)},l(n){d=s(n,"P",{});var g=r(d);v=c(g,"Example:"),g.forEach(o),u=h(n),E(m.$$.fragment,n)},m(n,g){_(n,d,g),t(d,v),_(n,u,g),w(m,n,g),b=!0},p:qo,i(n){b||(N(m.$$.fragment,n),b=!0)},o(n){$(m.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(u),M(m,n)}}}function Rn(C){let d,v,u,m,b;return{c(){d=a("p"),v=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=a("code"),m=i("Module"),b=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=s(n,"P",{});var g=r(d);v=c(g,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s(g,"CODE",{});var z=r(u);m=c(z,"Module"),z.forEach(o),b=c(g,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),g.forEach(o)},m(n,g){_(n,d,g),t(d,v),t(d,u),t(u,m),t(d,b)},d(n){n&&o(d)}}}function An(C){let d,v,u,m,b;return m=new Qo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudE5ldEZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVmZmljaWVudG5ldC1iNyUyMiklMEFtb2RlbCUyMCUzRCUyMEVmZmljaWVudE5ldEZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmdvb2dsZSUyRmVmZmljaWVudG5ldC1iNyUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cykubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9sYWJlbCUyMCUzRCUyMGxvZ2l0cy5hcmdtYXgoLTEpLml0ZW0oKSUwQXByaW50KG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9sYWJlbCU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;huggingface/cats-image&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>image = dataset[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-string">&quot;image&quot;</span>][<span class="hljs-number">0</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;google/efficientnet-b7&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = EfficientNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;google/efficientnet-b7&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tabby, tabby cat`}}),{c(){d=a("p"),v=i("Example:"),u=p(),y(m.$$.fragment)},l(n){d=s(n,"P",{});var g=r(d);v=c(g,"Example:"),g.forEach(o),u=h(n),E(m.$$.fragment,n)},m(n,g){_(n,d,g),t(d,v),_(n,u,g),w(m,n,g),b=!0},p:qo,i(n){b||(N(m.$$.fragment,n),b=!0)},o(n){$(m.$$.fragment,n),b=!1},d(n){n&&o(d),n&&o(u),M(m,n)}}}function Jn(C){let d,v,u,m,b,n,g,z,zt,lt,U,L,Le,re,Pt,Ge,Zt,dt,G,kt,ie,Ut,Wt,ft,xe,Ft,mt,je,qe,Rt,pt,k,At,ce,Jt,St,le,Vt,Bt,ht,W,q,Qe,de,Lt,Xe,Gt,gt,T,fe,qt,F,Qt,ze,Xt,Yt,me,Dt,Ot,Ht,R,Kt,Pe,eo,to,Ze,oo,no,ao,Q,ut,A,X,Ye,pe,so,De,ro,_t,P,he,io,Oe,co,lo,Y,ge,fo,He,mo,bt,J,D,Ke,ue,po,et,ho,vt,Z,_e,go,be,uo,ve,_o,bo,vo,x,ye,yo,S,Eo,ke,wo,No,tt,$o,Mo,To,O,Io,H,yt,V,K,ot,Ee,Co,nt,xo,Et,I,we,jo,at,zo,Po,Ne,Zo,$e,ko,Uo,Wo,j,Me,Fo,B,Ro,Ue,Ao,Jo,st,So,Vo,Bo,ee,Lo,te,wt;return n=new Be({}),re=new Be({}),de=new Be({}),fe=new Ce({props:{name:"class transformers.EfficientNetConfig",anchor:"transformers.EfficientNetConfig",parameters:[{name:"num_channels",val:": int = 3"},{name:"image_size",val:": int = 600"},{name:"width_coefficient",val:": float = 2.0"},{name:"depth_coefficient",val:": float = 3.1"},{name:"depth_divisor",val:": int = 8"},{name:"kernel_sizes",val:": typing.List[int] = [3, 3, 5, 3, 5, 5, 3]"},{name:"in_channels",val:": typing.List[int] = [32, 16, 24, 40, 80, 112, 192]"},{name:"out_channels",val:": typing.List[int] = [16, 24, 40, 80, 112, 192, 320]"},{name:"depthwise_padding",val:": typing.List[int] = []"},{name:"strides",val:": typing.List[int] = [1, 2, 2, 2, 1, 2, 1]"},{name:"num_block_repeats",val:": typing.List[int] = [1, 2, 2, 3, 3, 4, 1]"},{name:"expand_ratios",val:": typing.List[int] = [1, 6, 6, 6, 6, 6, 6]"},{name:"squeeze_expansion_ratio",val:": float = 0.25"},{name:"hidden_act",val:": str = 'swish'"},{name:"hidden_dim",val:": int = 2560"},{name:"pooling_type",val:": str = 'mean'"},{name:"initializer_range",val:": float = 0.02"},{name:"batch_norm_eps",val:": float = 0.001"},{name:"batch_norm_momentum",val:": float = 0.99"},{name:"dropout_rate",val:": float = 0.5"},{name:"drop_connect_rate",val:": float = 0.2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientNetConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.EfficientNetConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to 600) &#x2014;
The input image size.`,name:"image_size"},{anchor:"transformers.EfficientNetConfig.width_coefficient",description:`<strong>width_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 2.0) &#x2014;
Scaling coefficient for network width at each stage.`,name:"width_coefficient"},{anchor:"transformers.EfficientNetConfig.depth_coefficient",description:`<strong>depth_coefficient</strong> (<code>float</code>, <em>optional</em>, defaults to 3.1) &#x2014;
Scaling coefficient for network depth at each stage.`,name:"depth_coefficient"},{anchor:"transformers.EfficientNetConfig.depth_divisor",description:`<strong>depth_divisor</strong> <code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
A unit of network width.`,name:"depth_divisor"},{anchor:"transformers.EfficientNetConfig.kernel_sizes",description:`<strong>kernel_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 3, 5, 3, 5, 5, 3]</code>) &#x2014;
List of kernel sizes to be used in each block.`,name:"kernel_sizes"},{anchor:"transformers.EfficientNetConfig.in_channels",description:`<strong>in_channels</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[32, 16, 24, 40, 80, 112, 192]</code>) &#x2014;
List of input channel sizes to be used in each block for convolutional layers.`,name:"in_channels"},{anchor:"transformers.EfficientNetConfig.out_channels",description:`<strong>out_channels</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[16, 24, 40, 80, 112, 192, 320]</code>) &#x2014;
List of output channel sizes to be used in each block for convolutional layers.`,name:"out_channels"},{anchor:"transformers.EfficientNetConfig.depthwise_padding",description:`<strong>depthwise_padding</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[]</code>) &#x2014;
List of block indices with square padding.`,name:"depthwise_padding"},{anchor:"transformers.EfficientNetConfig.strides",description:`<strong>strides</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 2, 2, 1, 2, 1]</code>) &#x2014;
List of stride sizes to be used in each block for convolutional layers.`,name:"strides"},{anchor:"transformers.EfficientNetConfig.num_block_repeats",description:`<strong>num_block_repeats</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 2, 2, 3, 3, 4, 1]</code>) &#x2014;
List of the number of times each block is to repeated.`,name:"num_block_repeats"},{anchor:"transformers.EfficientNetConfig.expand_ratios",description:`<strong>expand_ratios</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1, 6, 6, 6, 6, 6, 6]</code>) &#x2014;
List of scaling coefficient of each block.`,name:"expand_ratios"},{anchor:"transformers.EfficientNetConfig.squeeze_expansion_ratio",description:`<strong>squeeze_expansion_ratio</strong> (<code>float</code>, <em>optional</em>, defaults to 0.25) &#x2014;
Squeeze expansion ratio.`,name:"squeeze_expansion_ratio"},{anchor:"transformers.EfficientNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;silu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in each block. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>,
<code>&quot;selu&quot;, </code>&#x201C;gelu_new&#x201D;<code>, </code>&#x201C;silu&#x201D;<code>and</code>&#x201C;mish&#x201D;\` are supported.`,name:"hidden_act"},{anchor:"transformers.EfficientNetConfig.hiddem_dim",description:`<strong>hiddem_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 1280) &#x2014;
The hidden dimension of the layer before the classification head.`,name:"hiddem_dim"},{anchor:"transformers.EfficientNetConfig.pooling_type",description:`<strong>pooling_type</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;mean&quot;</code>) &#x2014;
Type of final pooling to be applied before the dense classification head. Available options are [<code>&quot;mean&quot;</code>,
<code>&quot;max&quot;</code>]`,name:"pooling_type"},{anchor:"transformers.EfficientNetConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.EfficientNetConfig.batch_norm_eps",description:`<strong>batch_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-3) &#x2014;
The epsilon used by the batch normalization layers.`,name:"batch_norm_eps"},{anchor:"transformers.EfficientNetConfig.batch_norm_momentum",description:`<strong>batch_norm_momentum</strong> (<code>float</code>, <em>optional</em>, defaults to 0.99) &#x2014;
The momentum used by the batch normalization layers.`,name:"batch_norm_momentum"},{anchor:"transformers.EfficientNetConfig.dropout_rate",description:`<strong>dropout_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.5) &#x2014;
The dropout rate to be applied before final classifier layer.`,name:"dropout_rate"},{anchor:"transformers.EfficientNetConfig.drop_connect_rate",description:`<strong>drop_connect_rate</strong> (<code>float</code>, <em>optional</em>, defaults to 0.2) &#x2014;
The drop rate for skip connections.`,name:"drop_connect_rate"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/configuration_efficientnet.py#L34"}}),Q=new Go({props:{anchor:"transformers.EfficientNetConfig.example",$$slots:{default:[Un]},$$scope:{ctx:C}}}),pe=new Be({}),he=new Ce({props:{name:"class transformers.EfficientNetImageProcessor",anchor:"transformers.EfficientNetImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:": Resampling = 0"},{name:"do_center_crop",val:": bool = False"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"rescale_factor",val:": typing.Union[int, float] = 0.00392156862745098"},{name:"rescale_offset",val:": bool = False"},{name:"do_rescale",val:": bool = True"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"include_top",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientNetImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to resize the image&#x2019;s (height, width) dimensions to the specified <code>size</code>. Can be overridden by
<code>do_resize</code> in <code>preprocess</code>.`,name:"do_resize"},{anchor:"transformers.EfficientNetImageProcessor.size",description:`<strong>size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to <code>{&quot;height&quot; -- 346, &quot;width&quot;: 346}</code>):
Size of the image after <code>resize</code>. Can be overridden by <code>size</code> in <code>preprocess</code>.`,name:"size"},{anchor:"transformers.EfficientNetImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>PILImageResampling.NEAREST</code>) &#x2014;
Resampling filter to use if resizing the image. Can be overridden by <code>resample</code> in <code>preprocess</code>.`,name:"resample"},{anchor:"transformers.EfficientNetImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to center crop the image. If the input size is smaller than <code>crop_size</code> along any edge, the image
is padded with 0&#x2019;s and then center cropped. Can be overridden by <code>do_center_crop</code> in <code>preprocess</code>.`,name:"do_center_crop"},{anchor:"transformers.EfficientNetImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>{&quot;height&quot; -- 289, &quot;width&quot;: 289}</code>):
Desired output size when applying center-cropping. Can be overridden by <code>crop_size</code> in <code>preprocess</code>.`,name:"crop_size"},{anchor:"transformers.EfficientNetImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image by the specified scale <code>rescale_factor</code>. Can be overridden by the <code>do_rescale</code>
parameter in the <code>preprocess</code> method.`,name:"do_rescale"},{anchor:"transformers.EfficientNetImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) &#x2014;
Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the
<code>preprocess</code> method.`,name:"rescale_factor"},{anchor:"transformers.EfficientNetImageProcessor.rescale_offset",description:`<strong>rescale_offset</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to rescale the image between [-scale_range, scale_range] instead of [0, scale_range]. Can be
overridden by the <code>rescale_factor</code> parameter in the <code>preprocess</code> method.`,name:"rescale_offset"},{anchor:"transformers.EfficientNetImageProcessor.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code>
method.`,name:"do_normalize"},{anchor:"transformers.EfficientNetImageProcessor.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_MEAN</code>) &#x2014;
Mean to use if normalizing the image. This is a float or list of floats the length of the number of
channels in the image. Can be overridden by the <code>image_mean</code> parameter in the <code>preprocess</code> method.`,name:"image_mean"},{anchor:"transformers.EfficientNetImageProcessor.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>IMAGENET_STANDARD_STD</code>) &#x2014;
Standard deviation to use if normalizing the image. This is a float or list of floats the length of the
number of channels in the image. Can be overridden by the <code>image_std</code> parameter in the <code>preprocess</code> method.`,name:"image_std"},{anchor:"transformers.EfficientNetImageProcessor.include_top",description:`<strong>include_top</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to rescale the image again. Should be set to True if the inputs are used for image classification.`,name:"include_top"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/image_processing_efficientnet.py#L43"}}),ge=new Ce({props:{name:"preprocess",anchor:"transformers.EfficientNetImageProcessor.preprocess",parameters:[{name:"images",val:": typing.Union[ForwardRef('PIL.Image.Image'), numpy.ndarray, ForwardRef('torch.Tensor'), typing.List[ForwardRef('PIL.Image.Image')], typing.List[numpy.ndarray], typing.List[ForwardRef('torch.Tensor')]]"},{name:"do_resize",val:": bool = None"},{name:"size",val:": typing.Dict[str, int] = None"},{name:"resample",val:" = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": typing.Dict[str, int] = None"},{name:"do_rescale",val:": bool = None"},{name:"rescale_factor",val:": float = None"},{name:"rescale_offset",val:": bool = None"},{name:"do_normalize",val:": bool = None"},{name:"image_mean",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"image_std",val:": typing.Union[float, typing.List[float], NoneType] = None"},{name:"include_top",val:": bool = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"data_format",val:": ChannelDimension = <ChannelDimension.FIRST: 'channels_first'>"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientNetImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) &#x2014;
Image to preprocess.`,name:"images"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) &#x2014;
Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) &#x2014;
Size of the image after <code>resize</code>.`,name:"size"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>self.resample</code>) &#x2014;
PILImageResampling filter to use if resizing the image Only has an effect if <code>do_resize</code> is set to
<code>True</code>.`,name:"resample"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) &#x2014;
Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) &#x2014;
Size of the image after center crop. If one edge the image is smaller than <code>crop_size</code>, it will be
padded with zeros and then cropped`,name:"crop_size"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) &#x2014;
Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) &#x2014;
Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.rescale_offset",description:`<strong>rescale_offset</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.rescale_offset</code>) &#x2014;
Whether to rescale the image between [-scale_range, scale_range] instead of [0, scale_range].`,name:"rescale_offset"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) &#x2014;
Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.image_mean",description:`<strong>image_mean</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_mean</code>) &#x2014;
Image mean.`,name:"image_mean"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.image_std",description:`<strong>image_std</strong> (<code>float</code> or <code>List[float]</code>, <em>optional</em>, defaults to <code>self.image_std</code>) &#x2014;
Image standard deviation.`,name:"image_std"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.include_top",description:`<strong>include_top</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.include_top</code>) &#x2014;
Rescales the image again for image classification if set to True.`,name:"include_top"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) &#x2014;
The type of tensors to return. Can be one of:<ul>
<li><code>None</code>: Return a list of <code>np.ndarray</code>.</li>
<li><code>TensorType.TENSORFLOW</code> or <code>&apos;tf&apos;</code>: Return a batch of type <code>tf.Tensor</code>.</li>
<li><code>TensorType.PYTORCH</code> or <code>&apos;pt&apos;</code>: Return a batch of type <code>torch.Tensor</code>.</li>
<li><code>TensorType.NUMPY</code> or <code>&apos;np&apos;</code>: Return a batch of type <code>np.ndarray</code>.</li>
<li><code>TensorType.JAX</code> or <code>&apos;jax&apos;</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.EfficientNetImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) &#x2014;
The channel dimension format for the output image. Can be one of:<ul>
<li><code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li>
<li><code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li>
</ul>`,name:"data_format"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/image_processing_efficientnet.py#L224"}}),ue=new Be({}),_e=new Ce({props:{name:"class transformers.EfficientNetModel",anchor:"transformers.EfficientNetModel",parameters:[{name:"config",val:": EfficientNetConfig"}],parametersDescription:[{anchor:"transformers.EfficientNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetConfig">EfficientNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/modeling_efficientnet.py#L512"}}),ye=new Ce({props:{name:"forward",anchor:"transformers.EfficientNetModel.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EfficientNetModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientNetModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.EfficientNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/modeling_efficientnet.py#L530",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetConfig"
>EfficientNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),O=new xn({props:{$$slots:{default:[Wn]},$$scope:{ctx:C}}}),H=new Go({props:{anchor:"transformers.EfficientNetModel.forward.example",$$slots:{default:[Fn]},$$scope:{ctx:C}}}),Ee=new Be({}),we=new Ce({props:{name:"class transformers.EfficientNetForImageClassification",anchor:"transformers.EfficientNetForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.EfficientNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetConfig">EfficientNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/modeling_efficientnet.py#L582"}}),Me=new Ce({props:{name:"forward",anchor:"transformers.EfficientNetForImageClassification.forward",parameters:[{name:"pixel_values",val:": FloatTensor = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.EfficientNetForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<code>AutoImageProcessor.__call__()</code> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientNetForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.EfficientNetForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EfficientNetForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/efficientnet/modeling_efficientnet.py#L596",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetConfig"
>EfficientNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ee=new xn({props:{$$slots:{default:[Rn]},$$scope:{ctx:C}}}),te=new Go({props:{anchor:"transformers.EfficientNetForImageClassification.forward.example",$$slots:{default:[An]},$$scope:{ctx:C}}}),{c(){d=a("meta"),v=p(),u=a("h1"),m=a("a"),b=a("span"),y(n.$$.fragment),g=p(),z=a("span"),zt=i("EfficientNet"),lt=p(),U=a("h2"),L=a("a"),Le=a("span"),y(re.$$.fragment),Pt=p(),Ge=a("span"),Zt=i("Overview"),dt=p(),G=a("p"),kt=i("The EfficientNet model was proposed in "),ie=a("a"),Ut=i("EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks"),Wt=i(`
by Mingxing Tan and Quoc V. Le. EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models.`),ft=p(),xe=a("p"),Ft=i("The abstract from the paper is the following:"),mt=p(),je=a("p"),qe=a("em"),Rt=i(`Convolutional Neural Networks (ConvNets) are commonly developed at a fixed resource budget, and then scaled up for better accuracy if more resources are available. In this paper, we systematically study model scaling and identify that carefully balancing network depth, width, and resolution can lead to better performance. Based on this observation, we propose a new scaling method that uniformly scales all dimensions of depth/width/resolution using a simple yet highly effective compound coefficient. We demonstrate the effectiveness of this method on scaling up MobileNets and ResNet.
To go even further, we use neural architecture search to design a new baseline network and scale it up to obtain a family of models, called EfficientNets, which achieve much better accuracy and efficiency than previous ConvNets. In particular, our EfficientNet-B7 achieves state-of-the-art 84.3% top-1 accuracy on ImageNet, while being 8.4x smaller and 6.1x faster on inference than the best existing ConvNet. Our EfficientNets also transfer well and achieve state-of-the-art accuracy on CIFAR-100 (91.7%), Flowers (98.8%), and 3 other transfer learning datasets, with an order of magnitude fewer parameters.`),pt=p(),k=a("p"),At=i("This model was contributed by "),ce=a("a"),Jt=i("adirik"),St=i(`.
The original code can be found `),le=a("a"),Vt=i("here"),Bt=i("."),ht=p(),W=a("h2"),q=a("a"),Qe=a("span"),y(de.$$.fragment),Lt=p(),Xe=a("span"),Gt=i("EfficientNetConfig"),gt=p(),T=a("div"),y(fe.$$.fragment),qt=p(),F=a("p"),Qt=i("This is the configuration class to store the configuration of a "),ze=a("a"),Xt=i("EfficientNetModel"),Yt=i(`. It is used to instantiate an
EfficientNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the EfficientNet
`),me=a("a"),Dt=i("google/efficientnet-b7"),Ot=i(" architecture."),Ht=p(),R=a("p"),Kt=i("Configuration objects inherit from "),Pe=a("a"),eo=i("PretrainedConfig"),to=i(` and can be used to control the model outputs. Read the
documentation from `),Ze=a("a"),oo=i("PretrainedConfig"),no=i(" for more information."),ao=p(),y(Q.$$.fragment),ut=p(),A=a("h2"),X=a("a"),Ye=a("span"),y(pe.$$.fragment),so=p(),De=a("span"),ro=i("EfficientNetImageProcessor"),_t=p(),P=a("div"),y(he.$$.fragment),io=p(),Oe=a("p"),co=i("Constructs a EfficientNet image processor."),lo=p(),Y=a("div"),y(ge.$$.fragment),fo=p(),He=a("p"),mo=i("Preprocess an image or batch of images."),bt=p(),J=a("h2"),D=a("a"),Ke=a("span"),y(ue.$$.fragment),po=p(),et=a("span"),ho=i("EfficientNetModel"),vt=p(),Z=a("div"),y(_e.$$.fragment),go=p(),be=a("p"),uo=i(`The bare EfficientNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ve=a("a"),_o=i("torch.nn.Module"),bo=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vo=p(),x=a("div"),y(ye.$$.fragment),yo=p(),S=a("p"),Eo=i("The "),ke=a("a"),wo=i("EfficientNetModel"),No=i(" forward method, overrides the "),tt=a("code"),$o=i("__call__"),Mo=i(" special method."),To=p(),y(O.$$.fragment),Io=p(),y(H.$$.fragment),yt=p(),V=a("h2"),K=a("a"),ot=a("span"),y(Ee.$$.fragment),Co=p(),nt=a("span"),xo=i("EfficientNetForImageClassification"),Et=p(),I=a("div"),y(we.$$.fragment),jo=p(),at=a("p"),zo=i(`EfficientNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g.
for ImageNet.`),Po=p(),Ne=a("p"),Zo=i("This model is a PyTorch "),$e=a("a"),ko=i("torch.nn.Module"),Uo=i(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wo=p(),j=a("div"),y(Me.$$.fragment),Fo=p(),B=a("p"),Ro=i("The "),Ue=a("a"),Ao=i("EfficientNetForImageClassification"),Jo=i(" forward method, overrides the "),st=a("code"),So=i("__call__"),Vo=i(" special method."),Bo=p(),y(ee.$$.fragment),Lo=p(),y(te.$$.fragment),this.h()},l(e){const f=Zn('[data-svelte="svelte-1phssyn"]',document.head);d=s(f,"META",{name:!0,content:!0}),f.forEach(o),v=h(e),u=s(e,"H1",{class:!0});var Te=r(u);m=s(Te,"A",{id:!0,class:!0,href:!0});var rt=r(m);b=s(rt,"SPAN",{});var it=r(b);E(n.$$.fragment,it),it.forEach(o),rt.forEach(o),g=h(Te),z=s(Te,"SPAN",{});var ct=r(z);zt=c(ct,"EfficientNet"),ct.forEach(o),Te.forEach(o),lt=h(e),U=s(e,"H2",{class:!0});var Ie=r(U);L=s(Ie,"A",{id:!0,class:!0,href:!0});var Xo=r(L);Le=s(Xo,"SPAN",{});var Yo=r(Le);E(re.$$.fragment,Yo),Yo.forEach(o),Xo.forEach(o),Pt=h(Ie),Ge=s(Ie,"SPAN",{});var Do=r(Ge);Zt=c(Do,"Overview"),Do.forEach(o),Ie.forEach(o),dt=h(e),G=s(e,"P",{});var Nt=r(G);kt=c(Nt,"The EfficientNet model was proposed in "),ie=s(Nt,"A",{href:!0,rel:!0});var Oo=r(ie);Ut=c(Oo,"EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks"),Oo.forEach(o),Wt=c(Nt,`
by Mingxing Tan and Quoc V. Le. EfficientNets are a family of image classification models, which achieve state-of-the-art accuracy, yet being an order-of-magnitude smaller and faster than previous models.`),Nt.forEach(o),ft=h(e),xe=s(e,"P",{});var Ho=r(xe);Ft=c(Ho,"The abstract from the paper is the following:"),Ho.forEach(o),mt=h(e),je=s(e,"P",{});var Ko=r(je);qe=s(Ko,"EM",{});var en=r(qe);Rt=c(en,`Convolutional Neural Networks (ConvNets) are commonly developed at a fixed resource budget, and then scaled up for better accuracy if more resources are available. In this paper, we systematically study model scaling and identify that carefully balancing network depth, width, and resolution can lead to better performance. Based on this observation, we propose a new scaling method that uniformly scales all dimensions of depth/width/resolution using a simple yet highly effective compound coefficient. We demonstrate the effectiveness of this method on scaling up MobileNets and ResNet.
To go even further, we use neural architecture search to design a new baseline network and scale it up to obtain a family of models, called EfficientNets, which achieve much better accuracy and efficiency than previous ConvNets. In particular, our EfficientNet-B7 achieves state-of-the-art 84.3% top-1 accuracy on ImageNet, while being 8.4x smaller and 6.1x faster on inference than the best existing ConvNet. Our EfficientNets also transfer well and achieve state-of-the-art accuracy on CIFAR-100 (91.7%), Flowers (98.8%), and 3 other transfer learning datasets, with an order of magnitude fewer parameters.`),en.forEach(o),Ko.forEach(o),pt=h(e),k=s(e,"P",{});var We=r(k);At=c(We,"This model was contributed by "),ce=s(We,"A",{href:!0,rel:!0});var tn=r(ce);Jt=c(tn,"adirik"),tn.forEach(o),St=c(We,`.
The original code can be found `),le=s(We,"A",{href:!0,rel:!0});var on=r(le);Vt=c(on,"here"),on.forEach(o),Bt=c(We,"."),We.forEach(o),ht=h(e),W=s(e,"H2",{class:!0});var $t=r(W);q=s($t,"A",{id:!0,class:!0,href:!0});var nn=r(q);Qe=s(nn,"SPAN",{});var an=r(Qe);E(de.$$.fragment,an),an.forEach(o),nn.forEach(o),Lt=h($t),Xe=s($t,"SPAN",{});var sn=r(Xe);Gt=c(sn,"EfficientNetConfig"),sn.forEach(o),$t.forEach(o),gt=h(e),T=s(e,"DIV",{class:!0});var oe=r(T);E(fe.$$.fragment,oe),qt=h(oe),F=s(oe,"P",{});var Fe=r(F);Qt=c(Fe,"This is the configuration class to store the configuration of a "),ze=s(Fe,"A",{href:!0});var rn=r(ze);Xt=c(rn,"EfficientNetModel"),rn.forEach(o),Yt=c(Fe,`. It is used to instantiate an
EfficientNet model according to the specified arguments, defining the model architecture. Instantiating a
configuration with the defaults will yield a similar configuration to that of the EfficientNet
`),me=s(Fe,"A",{href:!0,rel:!0});var cn=r(me);Dt=c(cn,"google/efficientnet-b7"),cn.forEach(o),Ot=c(Fe," architecture."),Fe.forEach(o),Ht=h(oe),R=s(oe,"P",{});var Re=r(R);Kt=c(Re,"Configuration objects inherit from "),Pe=s(Re,"A",{href:!0});var ln=r(Pe);eo=c(ln,"PretrainedConfig"),ln.forEach(o),to=c(Re,` and can be used to control the model outputs. Read the
documentation from `),Ze=s(Re,"A",{href:!0});var dn=r(Ze);oo=c(dn,"PretrainedConfig"),dn.forEach(o),no=c(Re," for more information."),Re.forEach(o),ao=h(oe),E(Q.$$.fragment,oe),oe.forEach(o),ut=h(e),A=s(e,"H2",{class:!0});var Mt=r(A);X=s(Mt,"A",{id:!0,class:!0,href:!0});var fn=r(X);Ye=s(fn,"SPAN",{});var mn=r(Ye);E(pe.$$.fragment,mn),mn.forEach(o),fn.forEach(o),so=h(Mt),De=s(Mt,"SPAN",{});var pn=r(De);ro=c(pn,"EfficientNetImageProcessor"),pn.forEach(o),Mt.forEach(o),_t=h(e),P=s(e,"DIV",{class:!0});var Ae=r(P);E(he.$$.fragment,Ae),io=h(Ae),Oe=s(Ae,"P",{});var hn=r(Oe);co=c(hn,"Constructs a EfficientNet image processor."),hn.forEach(o),lo=h(Ae),Y=s(Ae,"DIV",{class:!0});var Tt=r(Y);E(ge.$$.fragment,Tt),fo=h(Tt),He=s(Tt,"P",{});var gn=r(He);mo=c(gn,"Preprocess an image or batch of images."),gn.forEach(o),Tt.forEach(o),Ae.forEach(o),bt=h(e),J=s(e,"H2",{class:!0});var It=r(J);D=s(It,"A",{id:!0,class:!0,href:!0});var un=r(D);Ke=s(un,"SPAN",{});var _n=r(Ke);E(ue.$$.fragment,_n),_n.forEach(o),un.forEach(o),po=h(It),et=s(It,"SPAN",{});var bn=r(et);ho=c(bn,"EfficientNetModel"),bn.forEach(o),It.forEach(o),vt=h(e),Z=s(e,"DIV",{class:!0});var Je=r(Z);E(_e.$$.fragment,Je),go=h(Je),be=s(Je,"P",{});var Ct=r(be);uo=c(Ct,`The bare EfficientNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ve=s(Ct,"A",{href:!0,rel:!0});var vn=r(ve);_o=c(vn,"torch.nn.Module"),vn.forEach(o),bo=c(Ct,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ct.forEach(o),vo=h(Je),x=s(Je,"DIV",{class:!0});var ne=r(x);E(ye.$$.fragment,ne),yo=h(ne),S=s(ne,"P",{});var Se=r(S);Eo=c(Se,"The "),ke=s(Se,"A",{href:!0});var yn=r(ke);wo=c(yn,"EfficientNetModel"),yn.forEach(o),No=c(Se," forward method, overrides the "),tt=s(Se,"CODE",{});var En=r(tt);$o=c(En,"__call__"),En.forEach(o),Mo=c(Se," special method."),Se.forEach(o),To=h(ne),E(O.$$.fragment,ne),Io=h(ne),E(H.$$.fragment,ne),ne.forEach(o),Je.forEach(o),yt=h(e),V=s(e,"H2",{class:!0});var xt=r(V);K=s(xt,"A",{id:!0,class:!0,href:!0});var wn=r(K);ot=s(wn,"SPAN",{});var Nn=r(ot);E(Ee.$$.fragment,Nn),Nn.forEach(o),wn.forEach(o),Co=h(xt),nt=s(xt,"SPAN",{});var $n=r(nt);xo=c($n,"EfficientNetForImageClassification"),$n.forEach(o),xt.forEach(o),Et=h(e),I=s(e,"DIV",{class:!0});var ae=r(I);E(we.$$.fragment,ae),jo=h(ae),at=s(ae,"P",{});var Mn=r(at);zo=c(Mn,`EfficientNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g.
for ImageNet.`),Mn.forEach(o),Po=h(ae),Ne=s(ae,"P",{});var jt=r(Ne);Zo=c(jt,"This model is a PyTorch "),$e=s(jt,"A",{href:!0,rel:!0});var Tn=r($e);ko=c(Tn,"torch.nn.Module"),Tn.forEach(o),Uo=c(jt,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jt.forEach(o),Wo=h(ae),j=s(ae,"DIV",{class:!0});var se=r(j);E(Me.$$.fragment,se),Fo=h(se),B=s(se,"P",{});var Ve=r(B);Ro=c(Ve,"The "),Ue=s(Ve,"A",{href:!0});var In=r(Ue);Ao=c(In,"EfficientNetForImageClassification"),In.forEach(o),Jo=c(Ve," forward method, overrides the "),st=s(Ve,"CODE",{});var Cn=r(st);So=c(Cn,"__call__"),Cn.forEach(o),Vo=c(Ve," special method."),Ve.forEach(o),Bo=h(se),E(ee.$$.fragment,se),Lo=h(se),E(te.$$.fragment,se),se.forEach(o),ae.forEach(o),this.h()},h(){l(d,"name","hf:doc:metadata"),l(d,"content",JSON.stringify(Sn)),l(m,"id","efficientnet"),l(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(m,"href","#efficientnet"),l(u,"class","relative group"),l(L,"id","overview"),l(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(L,"href","#overview"),l(U,"class","relative group"),l(ie,"href","https://arxiv.org/abs/1905.11946"),l(ie,"rel","nofollow"),l(ce,"href","https://huggingface.co/adirik"),l(ce,"rel","nofollow"),l(le,"href","https://github.com/tensorflow/tpu/tree/master/models/official/efficientnet"),l(le,"rel","nofollow"),l(q,"id","transformers.EfficientNetConfig"),l(q,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(q,"href","#transformers.EfficientNetConfig"),l(W,"class","relative group"),l(ze,"href","/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetModel"),l(me,"href","https://huggingface.co/google/efficientnet-b7"),l(me,"rel","nofollow"),l(Pe,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(Ze,"href","/docs/transformers/v4.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),l(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(X,"id","transformers.EfficientNetImageProcessor"),l(X,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(X,"href","#transformers.EfficientNetImageProcessor"),l(A,"class","relative group"),l(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(D,"id","transformers.EfficientNetModel"),l(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(D,"href","#transformers.EfficientNetModel"),l(J,"class","relative group"),l(ve,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l(ve,"rel","nofollow"),l(ke,"href","/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetModel"),l(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(K,"id","transformers.EfficientNetForImageClassification"),l(K,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(K,"href","#transformers.EfficientNetForImageClassification"),l(V,"class","relative group"),l($e,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),l($e,"rel","nofollow"),l(Ue,"href","/docs/transformers/v4.31.0/en/model_doc/efficientnet#transformers.EfficientNetForImageClassification"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,f){t(document.head,d),_(e,v,f),_(e,u,f),t(u,m),t(m,b),w(n,b,null),t(u,g),t(u,z),t(z,zt),_(e,lt,f),_(e,U,f),t(U,L),t(L,Le),w(re,Le,null),t(U,Pt),t(U,Ge),t(Ge,Zt),_(e,dt,f),_(e,G,f),t(G,kt),t(G,ie),t(ie,Ut),t(G,Wt),_(e,ft,f),_(e,xe,f),t(xe,Ft),_(e,mt,f),_(e,je,f),t(je,qe),t(qe,Rt),_(e,pt,f),_(e,k,f),t(k,At),t(k,ce),t(ce,Jt),t(k,St),t(k,le),t(le,Vt),t(k,Bt),_(e,ht,f),_(e,W,f),t(W,q),t(q,Qe),w(de,Qe,null),t(W,Lt),t(W,Xe),t(Xe,Gt),_(e,gt,f),_(e,T,f),w(fe,T,null),t(T,qt),t(T,F),t(F,Qt),t(F,ze),t(ze,Xt),t(F,Yt),t(F,me),t(me,Dt),t(F,Ot),t(T,Ht),t(T,R),t(R,Kt),t(R,Pe),t(Pe,eo),t(R,to),t(R,Ze),t(Ze,oo),t(R,no),t(T,ao),w(Q,T,null),_(e,ut,f),_(e,A,f),t(A,X),t(X,Ye),w(pe,Ye,null),t(A,so),t(A,De),t(De,ro),_(e,_t,f),_(e,P,f),w(he,P,null),t(P,io),t(P,Oe),t(Oe,co),t(P,lo),t(P,Y),w(ge,Y,null),t(Y,fo),t(Y,He),t(He,mo),_(e,bt,f),_(e,J,f),t(J,D),t(D,Ke),w(ue,Ke,null),t(J,po),t(J,et),t(et,ho),_(e,vt,f),_(e,Z,f),w(_e,Z,null),t(Z,go),t(Z,be),t(be,uo),t(be,ve),t(ve,_o),t(be,bo),t(Z,vo),t(Z,x),w(ye,x,null),t(x,yo),t(x,S),t(S,Eo),t(S,ke),t(ke,wo),t(S,No),t(S,tt),t(tt,$o),t(S,Mo),t(x,To),w(O,x,null),t(x,Io),w(H,x,null),_(e,yt,f),_(e,V,f),t(V,K),t(K,ot),w(Ee,ot,null),t(V,Co),t(V,nt),t(nt,xo),_(e,Et,f),_(e,I,f),w(we,I,null),t(I,jo),t(I,at),t(at,zo),t(I,Po),t(I,Ne),t(Ne,Zo),t(Ne,$e),t($e,ko),t(Ne,Uo),t(I,Wo),t(I,j),w(Me,j,null),t(j,Fo),t(j,B),t(B,Ro),t(B,Ue),t(Ue,Ao),t(B,Jo),t(B,st),t(st,So),t(B,Vo),t(j,Bo),w(ee,j,null),t(j,Lo),w(te,j,null),wt=!0},p(e,[f]){const Te={};f&2&&(Te.$$scope={dirty:f,ctx:e}),Q.$set(Te);const rt={};f&2&&(rt.$$scope={dirty:f,ctx:e}),O.$set(rt);const it={};f&2&&(it.$$scope={dirty:f,ctx:e}),H.$set(it);const ct={};f&2&&(ct.$$scope={dirty:f,ctx:e}),ee.$set(ct);const Ie={};f&2&&(Ie.$$scope={dirty:f,ctx:e}),te.$set(Ie)},i(e){wt||(N(n.$$.fragment,e),N(re.$$.fragment,e),N(de.$$.fragment,e),N(fe.$$.fragment,e),N(Q.$$.fragment,e),N(pe.$$.fragment,e),N(he.$$.fragment,e),N(ge.$$.fragment,e),N(ue.$$.fragment,e),N(_e.$$.fragment,e),N(ye.$$.fragment,e),N(O.$$.fragment,e),N(H.$$.fragment,e),N(Ee.$$.fragment,e),N(we.$$.fragment,e),N(Me.$$.fragment,e),N(ee.$$.fragment,e),N(te.$$.fragment,e),wt=!0)},o(e){$(n.$$.fragment,e),$(re.$$.fragment,e),$(de.$$.fragment,e),$(fe.$$.fragment,e),$(Q.$$.fragment,e),$(pe.$$.fragment,e),$(he.$$.fragment,e),$(ge.$$.fragment,e),$(ue.$$.fragment,e),$(_e.$$.fragment,e),$(ye.$$.fragment,e),$(O.$$.fragment,e),$(H.$$.fragment,e),$(Ee.$$.fragment,e),$(we.$$.fragment,e),$(Me.$$.fragment,e),$(ee.$$.fragment,e),$(te.$$.fragment,e),wt=!1},d(e){o(d),e&&o(v),e&&o(u),M(n),e&&o(lt),e&&o(U),M(re),e&&o(dt),e&&o(G),e&&o(ft),e&&o(xe),e&&o(mt),e&&o(je),e&&o(pt),e&&o(k),e&&o(ht),e&&o(W),M(de),e&&o(gt),e&&o(T),M(fe),M(Q),e&&o(ut),e&&o(A),M(pe),e&&o(_t),e&&o(P),M(he),M(ge),e&&o(bt),e&&o(J),M(ue),e&&o(vt),e&&o(Z),M(_e),M(ye),M(O),M(H),e&&o(yt),e&&o(V),M(Ee),e&&o(Et),e&&o(I),M(we),M(Me),M(ee),M(te)}}}const Sn={local:"efficientnet",sections:[{local:"overview",title:"Overview"},{local:"transformers.EfficientNetConfig",title:"EfficientNetConfig"},{local:"transformers.EfficientNetImageProcessor",title:"EfficientNetImageProcessor"},{local:"transformers.EfficientNetModel",title:"EfficientNetModel"},{local:"transformers.EfficientNetForImageClassification",title:"EfficientNetForImageClassification"}],title:"EfficientNet"};function Vn(C){return kn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Yn extends jn{constructor(d){super();zn(this,d,Vn,Jn,Pn,{})}}export{Yn as default,Sn as metadata};
