Buckets:
| import{s as qe,o as Xe,n as ue}from"../chunks/scheduler.25b97de1.js";import{S as He,i as Ye,g as p,s as l,r as _,A as Se,h,f as a,c,j as se,u as b,x as C,k as ae,y as d,a as f,v as y,d as T,t as F,w}from"../chunks/index.d9030fc9.js";import{T as Re}from"../chunks/Tip.baa67368.js";import{D as ge}from"../chunks/Docstring.e257edda.js";import{C as Pe}from"../chunks/CodeBlock.e6cd0d95.js";import{F as Qe,M as Le}from"../chunks/Markdown.7217f838.js";import{E as Ge}from"../chunks/ExampleCodeBlock.20db4b6e.js";import{H as Je,E as De}from"../chunks/EditOnGithub.91d95064.js";function Ae(E){let e,m=`This model is in maintenance mode only, we don’t accept any new PRs changing its code. | |
| If you run into any issues running this model, please reinstall the last version that supported this model: v4.40.2. | |
| You can do so by running the following command: <code>pip install -U transformers==4.40.2</code>.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-1sq0hrb"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function Oe(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEVmZmljaWVudEZvcm1lckNvbmZpZyUyQyUyMEVmZmljaWVudEZvcm1lck1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMEVmZmljaWVudEZvcm1lciUyMGVmZmljaWVudGZvcm1lci1sMSUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBFZmZpY2llbnRGb3JtZXJNb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwZWZmaWNpZW50Zm9ybWVyLWwzJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> EfficientFormerConfig, EfficientFormerModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a EfficientFormer efficientformer-l1 style configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = EfficientFormerConfig() | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Initializing a EfficientFormerModel (with random weights) from the efficientformer-l3 style configuration</span> | |
| <span class="hljs-meta">>>> </span>model = EfficientFormerModel(configuration) | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># Accessing the model configuration</span> | |
| <span class="hljs-meta">>>> </span>configuration = model.config`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function Ke(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function et(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lck1vZGVsJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEFtb2RlbCUyMCUzRCUyMEVmZmljaWVudEZvcm1lck1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = EfficientFormerModel.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">list</span>(last_hidden_states.shape) | |
| [<span class="hljs-number">1</span>, <span class="hljs-number">49</span>, <span class="hljs-number">448</span>]`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function tt(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function ot(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24lMEFpbXBvcnQlMjB0b3JjaCUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIyaHVnZ2luZ2ZhY2UlMkZjYXRzLWltYWdlJTIyJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKSUwQWltYWdlJTIwJTNEJTIwZGF0YXNldCU1QiUyMnRlc3QlMjIlNUQlNUIlMjJpbWFnZSUyMiU1RCU1QjAlNUQlMEElMEFpbWFnZV9wcm9jZXNzb3IlMjAlM0QlMjBBdXRvSW1hZ2VQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQW1vZGVsJTIwJTNEJTIwRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBsb2dpdHMuYXJnbWF4KC0xKS5pdGVtKCklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerForImageClassification | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = EfficientFormerForImageClassification.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item() | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| Egyptian cat`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function nt(E){let e,m=`This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet | |
| supported.`;return{c(){e=p("p"),e.textContent=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-1gp6z48"&&(e.textContent=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function rt(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function st(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb25XaXRoVGVhY2hlciUwQWltcG9ydCUyMHRvcmNoJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBbW9kZWwlMjAlM0QlMjBFZmZpY2llbnRGb3JtZXJGb3JJbWFnZUNsYXNzaWZpY2F0aW9uV2l0aFRlYWNoZXIuZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, EfficientFormerForImageClassificationWithTeacher | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> torch | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = EfficientFormerForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"pt"</span>) | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">with</span> torch.no_grad(): | |
| <span class="hljs-meta">... </span> logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item() | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| Egyptian cat`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function at(E){let e,m,t,r,g,o,v=`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top. | |
| This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</a> subclass. Use it as a | |
| regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`,ve,I,G,ce,ie,Ue='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerModel">EfficientFormerModel</a> forward method, overrides the <code>__call__</code> special method.',de,P,Ce,z,Ee,B,ee,x,L,me,Q,ye=`EfficientFormer Model transformer with an image classification head on top (a linear layer on top of the final | |
| hidden state of the [CLS] token) e.g. for ImageNet.`,ze,D,Te=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</a> subclass. Use it as a | |
| regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`,We,W,k,Ie,q,Ne='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassification">EfficientFormerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',xe,V,Ve,R,A,X,te,j,J,fe,oe,je=`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden | |
| state of the [CLS] token and a linear layer on top of the final hidden state of the distillation token) e.g. for | |
| ImageNet.`,ke,Y,pe,O,Fe=`This model is a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#nn.Module" rel="nofollow">nn.Module</a> subclass. Use it as a | |
| regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and behavior.`,we,S,U,H,he,ne='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassificationWithTeacher">EfficientFormerForImageClassificationWithTeacher</a> forward method, overrides the <code>__call__</code> special method.',Ze,K,re,n,u;return e=new Je({props:{title:"EfficientFormerModel",local:"transformers.EfficientFormerModel",headingTag:"h2"}}),r=new ge({props:{name:"class transformers.EfficientFormerModel",anchor:"transformers.EfficientFormerModel",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L545"}}),G=new ge({props:{name:"forward",anchor:"transformers.EfficientFormerModel.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.EfficientFormerModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.EfficientFormerModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.EfficientFormerModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L562",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling" | |
| >transformers.modeling_outputs.BaseModelOutputWithPooling</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — 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>) — Last layer hidden-state of the first token of the sequence (classification token) after further processing | |
| through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns | |
| the classification token after processing through a linear layer and a tanh activation function. The linear | |
| layer weights are trained from the next sentence prediction (classification) objective during pretraining.</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>) — 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, sequence_length, hidden_size)</code>.</p> | |
| <p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling" | |
| >transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),P=new Re({props:{$$slots:{default:[Ke]},$$scope:{ctx:E}}}),z=new Ge({props:{anchor:"transformers.EfficientFormerModel.forward.example",$$slots:{default:[et]},$$scope:{ctx:E}}}),B=new Je({props:{title:"EfficientFormerForImageClassification",local:"transformers.EfficientFormerForImageClassification",headingTag:"h2"}}),L=new ge({props:{name:"class transformers.EfficientFormerForImageClassification",anchor:"transformers.EfficientFormerForImageClassification",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L605"}}),k=new ge({props:{name:"forward",anchor:"transformers.EfficientFormerForImageClassification.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerForImageClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.EfficientFormerForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.EfficientFormerForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.EfficientFormerForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| 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 > 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L627",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput" | |
| >transformers.modeling_outputs.ImageClassifierOutput</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</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>) — 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, sequence_length, hidden_size)</code>. Hidden-states | |
| (also called feature maps) of the model at the output of each stage.</p> | |
| </li> | |
| <li> | |
| <p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutput" | |
| >transformers.modeling_outputs.ImageClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),V=new Re({props:{$$slots:{default:[tt]},$$scope:{ctx:E}}}),R=new Ge({props:{anchor:"transformers.EfficientFormerForImageClassification.forward.example",$$slots:{default:[ot]},$$scope:{ctx:E}}}),X=new Je({props:{title:"EfficientFormerForImageClassificationWithTeacher",local:"transformers.EfficientFormerForImageClassificationWithTeacher",headingTag:"h2"}}),J=new ge({props:{name:"class transformers.EfficientFormerForImageClassificationWithTeacher",anchor:"transformers.EfficientFormerForImageClassificationWithTeacher",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L727"}}),Y=new Re({props:{warning:!0,$$slots:{default:[nt]},$$scope:{ctx:E}}}),U=new ge({props:{name:"forward",anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"}],parametersDescription:[{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor">ViTImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/vit#transformers.ViTImageProcessor.preprocess">ViTImageProcessor.preprocess()</a> for details.`,name:"pixel_values"},{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.EfficientFormerForImageClassificationWithTeacher.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_efficientformer.py#L759",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.deprecated.efficientformer.modeling_efficientformer.EfficientFormerForImageClassificationWithTeacherOutput</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| <ul> | |
| <li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores as the average of the cls_logits and distillation logits.</li> | |
| <li><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the | |
| class token).</li> | |
| <li><strong>distillation_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the | |
| distillation token).</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>) — Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings + one for the output of each layer) of | |
| shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer | |
| plus the initial embedding outputs.</li> | |
| <li><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in | |
| the self-attention heads.</li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.deprecated.efficientformer.modeling_efficientformer.EfficientFormerForImageClassificationWithTeacherOutput</code> or <code>tuple(torch.FloatTensor)</code></p> | |
| `}}),K=new Re({props:{$$slots:{default:[rt]},$$scope:{ctx:E}}}),n=new Ge({props:{anchor:"transformers.EfficientFormerForImageClassificationWithTeacher.forward.example",$$slots:{default:[st]},$$scope:{ctx:E}}}),{c(){_(e.$$.fragment),m=l(),t=p("div"),_(r.$$.fragment),g=l(),o=p("p"),o.innerHTML=v,ve=l(),I=p("div"),_(G.$$.fragment),ce=l(),ie=p("p"),ie.innerHTML=Ue,de=l(),_(P.$$.fragment),Ce=l(),_(z.$$.fragment),Ee=l(),_(B.$$.fragment),ee=l(),x=p("div"),_(L.$$.fragment),me=l(),Q=p("p"),Q.textContent=ye,ze=l(),D=p("p"),D.innerHTML=Te,We=l(),W=p("div"),_(k.$$.fragment),Ie=l(),q=p("p"),q.innerHTML=Ne,xe=l(),_(V.$$.fragment),Ve=l(),_(R.$$.fragment),A=l(),_(X.$$.fragment),te=l(),j=p("div"),_(J.$$.fragment),fe=l(),oe=p("p"),oe.textContent=je,ke=l(),_(Y.$$.fragment),pe=l(),O=p("p"),O.innerHTML=Fe,we=l(),S=p("div"),_(U.$$.fragment),H=l(),he=p("p"),he.innerHTML=ne,Ze=l(),_(K.$$.fragment),re=l(),_(n.$$.fragment),this.h()},l(s){b(e.$$.fragment,s),m=c(s),t=h(s,"DIV",{class:!0});var $=se(t);b(r.$$.fragment,$),g=c($),o=h($,"P",{"data-svelte-h":!0}),C(o)!=="svelte-adm7u9"&&(o.innerHTML=v),ve=c($),I=h($,"DIV",{class:!0});var Z=se(I);b(G.$$.fragment,Z),ce=c(Z),ie=h(Z,"P",{"data-svelte-h":!0}),C(ie)!=="svelte-m4e93i"&&(ie.innerHTML=Ue),de=c(Z),b(P.$$.fragment,Z),Ce=c(Z),b(z.$$.fragment,Z),Z.forEach(a),$.forEach(a),Ee=c(s),b(B.$$.fragment,s),ee=c(s),x=h(s,"DIV",{class:!0});var le=se(x);b(L.$$.fragment,le),me=c(le),Q=h(le,"P",{"data-svelte-h":!0}),C(Q)!=="svelte-qa8pu3"&&(Q.textContent=ye),ze=c(le),D=h(le,"P",{"data-svelte-h":!0}),C(D)!=="svelte-11dly9a"&&(D.innerHTML=Te),We=c(le),W=h(le,"DIV",{class:!0});var i=se(W);b(k.$$.fragment,i),Ie=c(i),q=h(i,"P",{"data-svelte-h":!0}),C(q)!=="svelte-94ruxw"&&(q.innerHTML=Ne),xe=c(i),b(V.$$.fragment,i),Ve=c(i),b(R.$$.fragment,i),i.forEach(a),le.forEach(a),A=c(s),b(X.$$.fragment,s),te=c(s),j=h(s,"DIV",{class:!0});var M=se(j);b(J.$$.fragment,M),fe=c(M),oe=h(M,"P",{"data-svelte-h":!0}),C(oe)!=="svelte-105ubol"&&(oe.textContent=je),ke=c(M),b(Y.$$.fragment,M),pe=c(M),O=h(M,"P",{"data-svelte-h":!0}),C(O)!=="svelte-11dly9a"&&(O.innerHTML=Fe),we=c(M),S=h(M,"DIV",{class:!0});var N=se(S);b(U.$$.fragment,N),H=c(N),he=h(N,"P",{"data-svelte-h":!0}),C(he)!=="svelte-nd0jo4"&&(he.innerHTML=ne),Ze=c(N),b(K.$$.fragment,N),re=c(N),b(n.$$.fragment,N),N.forEach(a),M.forEach(a),this.h()},h(){ae(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,$){y(e,s,$),f(s,m,$),f(s,t,$),y(r,t,null),d(t,g),d(t,o),d(t,ve),d(t,I),y(G,I,null),d(I,ce),d(I,ie),d(I,de),y(P,I,null),d(I,Ce),y(z,I,null),f(s,Ee,$),y(B,s,$),f(s,ee,$),f(s,x,$),y(L,x,null),d(x,me),d(x,Q),d(x,ze),d(x,D),d(x,We),d(x,W),y(k,W,null),d(W,Ie),d(W,q),d(W,xe),y(V,W,null),d(W,Ve),y(R,W,null),f(s,A,$),y(X,s,$),f(s,te,$),f(s,j,$),y(J,j,null),d(j,fe),d(j,oe),d(j,ke),y(Y,j,null),d(j,pe),d(j,O),d(j,we),d(j,S),y(U,S,null),d(S,H),d(S,he),d(S,Ze),y(K,S,null),d(S,re),y(n,S,null),u=!0},p(s,$){const Z={};$&2&&(Z.$$scope={dirty:$,ctx:s}),P.$set(Z);const le={};$&2&&(le.$$scope={dirty:$,ctx:s}),z.$set(le);const i={};$&2&&(i.$$scope={dirty:$,ctx:s}),V.$set(i);const M={};$&2&&(M.$$scope={dirty:$,ctx:s}),R.$set(M);const N={};$&2&&(N.$$scope={dirty:$,ctx:s}),Y.$set(N);const _e={};$&2&&(_e.$$scope={dirty:$,ctx:s}),K.$set(_e);const be={};$&2&&(be.$$scope={dirty:$,ctx:s}),n.$set(be)},i(s){u||(T(e.$$.fragment,s),T(r.$$.fragment,s),T(G.$$.fragment,s),T(P.$$.fragment,s),T(z.$$.fragment,s),T(B.$$.fragment,s),T(L.$$.fragment,s),T(k.$$.fragment,s),T(V.$$.fragment,s),T(R.$$.fragment,s),T(X.$$.fragment,s),T(J.$$.fragment,s),T(Y.$$.fragment,s),T(U.$$.fragment,s),T(K.$$.fragment,s),T(n.$$.fragment,s),u=!0)},o(s){F(e.$$.fragment,s),F(r.$$.fragment,s),F(G.$$.fragment,s),F(P.$$.fragment,s),F(z.$$.fragment,s),F(B.$$.fragment,s),F(L.$$.fragment,s),F(k.$$.fragment,s),F(V.$$.fragment,s),F(R.$$.fragment,s),F(X.$$.fragment,s),F(J.$$.fragment,s),F(Y.$$.fragment,s),F(U.$$.fragment,s),F(K.$$.fragment,s),F(n.$$.fragment,s),u=!1},d(s){s&&(a(m),a(t),a(Ee),a(ee),a(x),a(A),a(te),a(j)),w(e,s),w(r),w(G),w(P),w(z),w(B,s),w(L),w(k),w(V),w(R),w(X,s),w(J),w(Y),w(U),w(K),w(n)}}}function it(E){let e,m;return e=new Le({props:{$$slots:{default:[at]},$$scope:{ctx:E}}}),{c(){_(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,r){y(e,t,r),m=!0},p(t,r){const g={};r&2&&(g.$$scope={dirty:r,ctx:t}),e.$set(g)},i(t){m||(T(e.$$.fragment,t),m=!0)},o(t){F(e.$$.fragment,t),m=!1},d(t){w(e,t)}}}function lt(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function ct(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRWZmaWNpZW50Rm9ybWVyTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRWZmaWNpZW50Rm9ybWVyTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUlMEFsaXN0KGxhc3RfaGlkZGVuX3N0YXRlcy5zaGFwZSk=",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFEfficientFormerModel | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = TFEfficientFormerModel.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"tf"</span>) | |
| <span class="hljs-meta">>>> </span>outputs = model(**inputs) | |
| <span class="hljs-meta">>>> </span>last_hidden_states = outputs.last_hidden_state | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">list</span>(last_hidden_states.shape) | |
| [<span class="hljs-number">1</span>, <span class="hljs-number">49</span>, <span class="hljs-number">448</span>]`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function dt(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function mt(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbiUwQWltcG9ydCUyMHRlbnNvcmZsb3clMjBhcyUyMHRmJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJodWdnaW5nZmFjZSUyRmNhdHMtaW1hZ2UlMjIlMkMlMjB0cnVzdF9yZW1vdGVfY29kZSUzRFRydWUpJTBBaW1hZ2UlMjAlM0QlMjBkYXRhc2V0JTVCJTIydGVzdCUyMiU1RCU1QiUyMmltYWdlJTIyJTVEJTVCMCU1RCUwQSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyc25hcC1yZXNlYXJjaCUyRmVmZmljaWVudGZvcm1lci1sMS0zMDAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURkVmZmljaWVudEZvcm1lckZvckltYWdlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnNuYXAtcmVzZWFyY2glMkZlZmZpY2llbnRmb3JtZXItbDEtMzAwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cyUwQSUwQSUyMyUyMG1vZGVsJTIwcHJlZGljdHMlMjBvbmUlMjBvZiUyMHRoZSUyMDEwMDAlMjBJbWFnZU5ldCUyMGNsYXNzZXMlMEFwcmVkaWN0ZWRfbGFiZWwlMjAlM0QlMjBpbnQodGYubWF0aC5hcmdtYXgobG9naXRzJTJDJTIwYXhpcyUzRC0xKSklMEFwcmludChtb2RlbC5jb25maWcuaWQybGFiZWwlNUJwcmVkaWN0ZWRfbGFiZWwlNUQp",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFEfficientFormerForImageClassification | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = TFEfficientFormerForImageClassification.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"tf"</span>) | |
| <span class="hljs-meta">>>> </span>logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)) | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| LABEL_281`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function ft(E){let e,m=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code> | |
| instance afterwards instead of this since the former takes care of running the pre and post processing steps while | |
| the latter silently ignores them.`;return{c(){e=p("p"),e.innerHTML=m},l(t){e=h(t,"P",{"data-svelte-h":!0}),C(e)!=="svelte-fincs2"&&(e.innerHTML=m)},m(t,r){f(t,e,r)},p:ue,d(t){t&&a(e)}}}function pt(E){let e,m="Example:",t,r,g;return r=new Pe({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyJTBBaW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiUyQyUyMHRydXN0X3JlbW90ZV9jb2RlJTNEVHJ1ZSklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEFtb2RlbCUyMCUzRCUyMFRGRWZmaWNpZW50Rm9ybWVyRm9ySW1hZ2VDbGFzc2lmaWNhdGlvbldpdGhUZWFjaGVyLmZyb21fcHJldHJhaW5lZCglMjJzbmFwLXJlc2VhcmNoJTJGZWZmaWNpZW50Zm9ybWVyLWwxLTMwMCUyMiklMEElMEFpbnB1dHMlMjAlM0QlMjBpbWFnZV9wcm9jZXNzb3IoaW1hZ2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQWxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHMlMEElMEElMjMlMjBtb2RlbCUyMHByZWRpY3RzJTIwb25lJTIwb2YlMjB0aGUlMjAxMDAwJTIwSW1hZ2VOZXQlMjBjbGFzc2VzJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSkpJTBBcHJpbnQobW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2xhYmVsJTVEKQ==",highlighted:`<span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFEfficientFormerForImageClassificationWithTeacher | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf | |
| <span class="hljs-meta">>>> </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset | |
| <span class="hljs-meta">>>> </span>dataset = load_dataset(<span class="hljs-string">"huggingface/cats-image"</span>, trust_remote_code=<span class="hljs-literal">True</span>) | |
| <span class="hljs-meta">>>> </span>image = dataset[<span class="hljs-string">"test"</span>][<span class="hljs-string">"image"</span>][<span class="hljs-number">0</span>] | |
| <span class="hljs-meta">>>> </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>model = TFEfficientFormerForImageClassificationWithTeacher.from_pretrained(<span class="hljs-string">"snap-research/efficientformer-l1-300"</span>) | |
| <span class="hljs-meta">>>> </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">"tf"</span>) | |
| <span class="hljs-meta">>>> </span>logits = model(**inputs).logits | |
| <span class="hljs-meta">>>> </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span> | |
| <span class="hljs-meta">>>> </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)) | |
| <span class="hljs-meta">>>> </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label]) | |
| LABEL_281`,wrap:!1}}),{c(){e=p("p"),e.textContent=m,t=l(),_(r.$$.fragment)},l(o){e=h(o,"P",{"data-svelte-h":!0}),C(e)!=="svelte-11lpom8"&&(e.textContent=m),t=c(o),b(r.$$.fragment,o)},m(o,v){f(o,e,v),f(o,t,v),y(r,o,v),g=!0},p:ue,i(o){g||(T(r.$$.fragment,o),g=!0)},o(o){F(r.$$.fragment,o),g=!1},d(o){o&&(a(e),a(t)),w(r,o)}}}function ht(E){let e,m,t,r,g,o,v=`The bare EfficientFormer Model transformer outputting raw hidden-states without any specific head on top. | |
| This model is a TensorFlow | |
| <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer" rel="nofollow">keras.layers.Layer</a>. Use it as a regular | |
| TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`,ve,I,G,ce,ie,Ue='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.TFEfficientFormerModel">TFEfficientFormerModel</a> forward method, overrides the <code>__call__</code> special method.',de,P,Ce,z,Ee,B,ee,x,L,me,Q,ye=`EfficientFormer Model transformer with an image classification head on top of pooled last hidden state, e.g. for | |
| ImageNet.`,ze,D,Te=`This model is a TensorFlow | |
| <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer" rel="nofollow">keras.layers.Layer</a>. Use it as a regular | |
| TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`,We,W,k,Ie,q,Ne='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassification">TFEfficientFormerForImageClassification</a> forward method, overrides the <code>__call__</code> special method.',xe,V,Ve,R,A,X,te,j,J,fe,oe,je=`EfficientFormer Model transformer with image classification heads on top (a linear layer on top of the final hidden | |
| state and a linear layer on top of the final hidden state of the distillation token) e.g. for ImageNet.`,ke,Y,pe=`.. warning:: | |
| This model supports inference-only. Fine-tuning with distillation (i.e. with a teacher) is not yet | |
| supported.`,O,Fe,we=`This model is a TensorFlow | |
| <a href="https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer" rel="nofollow">keras.layers.Layer</a>. Use it as a regular | |
| TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and behavior.`,S,U,H,he,ne,Ze='The <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.TFEfficientFormerForImageClassificationWithTeacher">TFEfficientFormerForImageClassificationWithTeacher</a> forward method, overrides the <code>__call__</code> special method.',K,re,n,u,s=`<li><strong>Output</strong> type of <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerForImageClassificationWithTeacher">EfficientFormerForImageClassificationWithTeacher</a>. | |
| logits (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores as the average of the cls_logits and distillation logits. | |
| cls_logits (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the classification head (i.e. the linear layer on top of the final hidden state of the | |
| class token). | |
| distillation_logits (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Prediction scores of the distillation head (i.e. the linear layer on top of the final hidden state of the | |
| distillation token). | |
| hidden_states (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when | |
| <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape | |
| <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer plus | |
| the initial embedding outputs. | |
| attentions (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when | |
| <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>. Attentions weights after the attention softmax, used to compute the weighted average in | |
| the self-attention heads.</li>`,$,Z,le;return e=new Je({props:{title:"TFEfficientFormerModel",local:"transformers.TFEfficientFormerModel",headingTag:"h2"}}),r=new ge({props:{name:"class transformers.TFEfficientFormerModel",anchor:"transformers.TFEfficientFormerModel",parameters:[{name:"config",val:": EfficientFormerConfig"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFEfficientFormerModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L938"}}),G=new ge({props:{name:"call",anchor:"transformers.TFEfficientFormerModel.call",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerModel.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerModel.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.TFEfficientFormerModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L948",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling" | |
| >transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or a tuple of <code>tf.Tensor</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) — Sequence of hidden-states at the output of the last layer of the model.</p> | |
| </li> | |
| <li> | |
| <p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) — Last layer hidden-state of the first token of the sequence (classification token) further processed by a | |
| Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence | |
| prediction (classification) objective during pretraining.</p> | |
| <p>This output is usually <em>not</em> a good summary of the semantic content of the input, you’re often better with | |
| averaging or pooling the sequence of hidden-states for the whole input sequence.</p> | |
| </li> | |
| <li> | |
| <p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</code> (one for the output of the embeddings + one for the output of each layer) of shape | |
| <code>(batch_size, sequence_length, hidden_size)</code>.</p> | |
| <p>Hidden-states of the model at the output of each layer plus the initial embedding outputs.</p> | |
| </li> | |
| <li> | |
| <p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><a | |
| href="/docs/transformers/pr_32189/en/main_classes/output#transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling" | |
| >transformers.modeling_tf_outputs.TFBaseModelOutputWithPooling</a> or <code>tuple(tf.Tensor)</code></p> | |
| `}}),P=new Re({props:{$$slots:{default:[lt]},$$scope:{ctx:E}}}),z=new Ge({props:{anchor:"transformers.TFEfficientFormerModel.call.example",$$slots:{default:[ct]},$$scope:{ctx:E}}}),B=new Je({props:{title:"TFEfficientFormerForImageClassification",local:"transformers.TFEfficientFormerForImageClassification",headingTag:"h2"}}),L=new ge({props:{name:"class transformers.TFEfficientFormerForImageClassification",anchor:"transformers.TFEfficientFormerForImageClassification",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L983"}}),k=new ge({props:{name:"call",anchor:"transformers.TFEfficientFormerForImageClassification.call",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"labels",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.TFEfficientFormerForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFEfficientFormerForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) — | |
| 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 > 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L1005",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or a tuple of <code>tf.Tensor</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| <ul> | |
| <li> | |
| <p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) — Classification (or regression if config.num_labels==1) loss.</p> | |
| </li> | |
| <li> | |
| <p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) — Classification (or regression if config.num_labels==1) scores (before SoftMax).</p> | |
| </li> | |
| <li> | |
| <p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) — Tuple of <code>tf.Tensor</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, sequence_length, hidden_size)</code>. Hidden-states (also called | |
| feature maps) of the model at the output of each stage.</p> | |
| </li> | |
| <li> | |
| <p><strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) — Tuple of <code>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, patch_size, sequence_length)</code>.</p> | |
| <p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention | |
| heads.</p> | |
| </li> | |
| </ul> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.modeling_tf_outputs.TFImageClassifierOutput</code> or <code>tuple(tf.Tensor)</code></p> | |
| `}}),V=new Re({props:{$$slots:{default:[dt]},$$scope:{ctx:E}}}),R=new Ge({props:{anchor:"transformers.TFEfficientFormerForImageClassification.call.example",$$slots:{default:[mt]},$$scope:{ctx:E}}}),X=new Je({props:{title:"TFEfficientFormerForImageClassificationWithTeacher",local:"transformers.TFEfficientFormerForImageClassificationWithTeacher",headingTag:"h2"}}),J=new ge({props:{name:"class transformers.TFEfficientFormerForImageClassificationWithTeacher",anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher",parameters:[{name:"config",val:": EfficientFormerConfig"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.config",description:`<strong>config</strong> (<a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig">EfficientFormerConfig</a>) — 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/pr_32189/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/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L1097"}}),H=new ge({props:{name:"call",anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call",parameters:[{name:"pixel_values",val:": Optional = None"},{name:"output_attentions",val:": Optional = None"},{name:"output_hidden_states",val:": Optional = None"},{name:"return_dict",val:": Optional = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.pixel_values",description:`<strong>pixel_values</strong> ((<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) — | |
| Pixel values. Pixel values can be obtained using <a href="/docs/transformers/pr_32189/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See | |
| <a href="/docs/transformers/pr_32189/en/model_doc/levit#transformers.LevitFeatureExtractor.__call__">EfficientFormerImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned | |
| tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) — | |
| 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.TFEfficientFormerForImageClassificationWithTeacher.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) — | |
| Whether or not to return a <a href="/docs/transformers/pr_32189/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/modeling_tf_efficientformer.py#L1127",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p>A <code>transformers.models.deprecated.efficientformer.modeling_tf_efficientformer.TFEfficientFormerForImageClassificationWithTeacherOutput</code> or a tuple of <code>tf.Tensor</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/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerConfig" | |
| >EfficientFormerConfig</a>) and inputs.</p> | |
| `,returnType:`<script context="module">export const metadata = 'undefined';<\/script> | |
| <p><code>transformers.models.deprecated.efficientformer.modeling_tf_efficientformer.TFEfficientFormerForImageClassificationWithTeacherOutput</code> or <code>tuple(tf.Tensor)</code></p> | |
| `}}),re=new Re({props:{$$slots:{default:[ft]},$$scope:{ctx:E}}}),Z=new Ge({props:{anchor:"transformers.TFEfficientFormerForImageClassificationWithTeacher.call.example",$$slots:{default:[pt]},$$scope:{ctx:E}}}),{c(){_(e.$$.fragment),m=l(),t=p("div"),_(r.$$.fragment),g=l(),o=p("p"),o.innerHTML=v,ve=l(),I=p("div"),_(G.$$.fragment),ce=l(),ie=p("p"),ie.innerHTML=Ue,de=l(),_(P.$$.fragment),Ce=l(),_(z.$$.fragment),Ee=l(),_(B.$$.fragment),ee=l(),x=p("div"),_(L.$$.fragment),me=l(),Q=p("p"),Q.textContent=ye,ze=l(),D=p("p"),D.innerHTML=Te,We=l(),W=p("div"),_(k.$$.fragment),Ie=l(),q=p("p"),q.innerHTML=Ne,xe=l(),_(V.$$.fragment),Ve=l(),_(R.$$.fragment),A=l(),_(X.$$.fragment),te=l(),j=p("div"),_(J.$$.fragment),fe=l(),oe=p("p"),oe.textContent=je,ke=l(),Y=p("p"),Y.textContent=pe,O=l(),Fe=p("p"),Fe.innerHTML=we,S=l(),U=p("div"),_(H.$$.fragment),he=l(),ne=p("p"),ne.innerHTML=Ze,K=l(),_(re.$$.fragment),n=l(),u=p("ul"),u.innerHTML=s,$=l(),_(Z.$$.fragment),this.h()},l(i){b(e.$$.fragment,i),m=c(i),t=h(i,"DIV",{class:!0});var M=se(t);b(r.$$.fragment,M),g=c(M),o=h(M,"P",{"data-svelte-h":!0}),C(o)!=="svelte-15raqgn"&&(o.innerHTML=v),ve=c(M),I=h(M,"DIV",{class:!0});var N=se(I);b(G.$$.fragment,N),ce=c(N),ie=h(N,"P",{"data-svelte-h":!0}),C(ie)!=="svelte-1waughq"&&(ie.innerHTML=Ue),de=c(N),b(P.$$.fragment,N),Ce=c(N),b(z.$$.fragment,N),N.forEach(a),M.forEach(a),Ee=c(i),b(B.$$.fragment,i),ee=c(i),x=h(i,"DIV",{class:!0});var _e=se(x);b(L.$$.fragment,_e),me=c(_e),Q=h(_e,"P",{"data-svelte-h":!0}),C(Q)!=="svelte-iwgv3e"&&(Q.textContent=ye),ze=c(_e),D=h(_e,"P",{"data-svelte-h":!0}),C(D)!=="svelte-1jzqql0"&&(D.innerHTML=Te),We=c(_e),W=h(_e,"DIV",{class:!0});var be=se(W);b(k.$$.fragment,be),Ie=c(be),q=h(be,"P",{"data-svelte-h":!0}),C(q)!=="svelte-dou0k"&&(q.innerHTML=Ne),xe=c(be),b(V.$$.fragment,be),Ve=c(be),b(R.$$.fragment,be),be.forEach(a),_e.forEach(a),A=c(i),b(X.$$.fragment,i),te=c(i),j=h(i,"DIV",{class:!0});var $e=se(j);b(J.$$.fragment,$e),fe=c($e),oe=h($e,"P",{"data-svelte-h":!0}),C(oe)!=="svelte-yw5jbc"&&(oe.textContent=je),ke=c($e),Y=h($e,"P",{"data-svelte-h":!0}),C(Y)!=="svelte-tyl86q"&&(Y.textContent=pe),O=c($e),Fe=h($e,"P",{"data-svelte-h":!0}),C(Fe)!=="svelte-1jzqql0"&&(Fe.innerHTML=we),S=c($e),U=h($e,"DIV",{class:!0});var Me=se(U);b(H.$$.fragment,Me),he=c(Me),ne=h(Me,"P",{"data-svelte-h":!0}),C(ne)!=="svelte-enfl7w"&&(ne.innerHTML=Ze),K=c(Me),b(re.$$.fragment,Me),n=c(Me),u=h(Me,"UL",{"data-svelte-h":!0}),C(u)!=="svelte-1k6n755"&&(u.innerHTML=s),$=c(Me),b(Z.$$.fragment,Me),Me.forEach(a),$e.forEach(a),this.h()},h(){ae(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,M){y(e,i,M),f(i,m,M),f(i,t,M),y(r,t,null),d(t,g),d(t,o),d(t,ve),d(t,I),y(G,I,null),d(I,ce),d(I,ie),d(I,de),y(P,I,null),d(I,Ce),y(z,I,null),f(i,Ee,M),y(B,i,M),f(i,ee,M),f(i,x,M),y(L,x,null),d(x,me),d(x,Q),d(x,ze),d(x,D),d(x,We),d(x,W),y(k,W,null),d(W,Ie),d(W,q),d(W,xe),y(V,W,null),d(W,Ve),y(R,W,null),f(i,A,M),y(X,i,M),f(i,te,M),f(i,j,M),y(J,j,null),d(j,fe),d(j,oe),d(j,ke),d(j,Y),d(j,O),d(j,Fe),d(j,S),d(j,U),y(H,U,null),d(U,he),d(U,ne),d(U,K),y(re,U,null),d(U,n),d(U,u),d(U,$),y(Z,U,null),le=!0},p(i,M){const N={};M&2&&(N.$$scope={dirty:M,ctx:i}),P.$set(N);const _e={};M&2&&(_e.$$scope={dirty:M,ctx:i}),z.$set(_e);const be={};M&2&&(be.$$scope={dirty:M,ctx:i}),V.$set(be);const $e={};M&2&&($e.$$scope={dirty:M,ctx:i}),R.$set($e);const Me={};M&2&&(Me.$$scope={dirty:M,ctx:i}),re.$set(Me);const Be={};M&2&&(Be.$$scope={dirty:M,ctx:i}),Z.$set(Be)},i(i){le||(T(e.$$.fragment,i),T(r.$$.fragment,i),T(G.$$.fragment,i),T(P.$$.fragment,i),T(z.$$.fragment,i),T(B.$$.fragment,i),T(L.$$.fragment,i),T(k.$$.fragment,i),T(V.$$.fragment,i),T(R.$$.fragment,i),T(X.$$.fragment,i),T(J.$$.fragment,i),T(H.$$.fragment,i),T(re.$$.fragment,i),T(Z.$$.fragment,i),le=!0)},o(i){F(e.$$.fragment,i),F(r.$$.fragment,i),F(G.$$.fragment,i),F(P.$$.fragment,i),F(z.$$.fragment,i),F(B.$$.fragment,i),F(L.$$.fragment,i),F(k.$$.fragment,i),F(V.$$.fragment,i),F(R.$$.fragment,i),F(X.$$.fragment,i),F(J.$$.fragment,i),F(H.$$.fragment,i),F(re.$$.fragment,i),F(Z.$$.fragment,i),le=!1},d(i){i&&(a(m),a(t),a(Ee),a(ee),a(x),a(A),a(te),a(j)),w(e,i),w(r),w(G),w(P),w(z),w(B,i),w(L),w(k),w(V),w(R),w(X,i),w(J),w(H),w(re),w(Z)}}}function gt(E){let e,m;return e=new Le({props:{$$slots:{default:[ht]},$$scope:{ctx:E}}}),{c(){_(e.$$.fragment)},l(t){b(e.$$.fragment,t)},m(t,r){y(e,t,r),m=!0},p(t,r){const g={};r&2&&(g.$$scope={dirty:r,ctx:t}),e.$set(g)},i(t){m||(T(e.$$.fragment,t),m=!0)},o(t){F(e.$$.fragment,t),m=!1},d(t){w(e,t)}}}function ut(E){let e,m,t,r,g,o,v,ve,I,G,ce,ie=`The EfficientFormer model was proposed in <a href="https://arxiv.org/abs/2206.01191" rel="nofollow">EfficientFormer: Vision Transformers at MobileNet Speed</a> | |
| by Yanyu Li, Geng Yuan, Yang Wen, Eric Hu, Georgios Evangelidis, Sergey Tulyakov, Yanzhi Wang, Jian Ren. EfficientFormer proposes a | |
| dimension-consistent pure transformer that can be run on mobile devices for dense prediction tasks like image classification, object | |
| detection and semantic segmentation.`,Ue,de,P="The abstract from the paper is the following:",Ce,z,Ee=`<em>Vision Transformers (ViT) have shown rapid progress in computer vision tasks, achieving promising results on various benchmarks. | |
| However, due to the massive number of parameters and model design, e.g., attention mechanism, ViT-based models are generally | |
| times slower than lightweight convolutional networks. Therefore, the deployment of ViT for real-time applications is particularly | |
| challenging, especially on resource-constrained hardware such as mobile devices. Recent efforts try to reduce the computation | |
| complexity of ViT through network architecture search or hybrid design with MobileNet block, yet the inference speed is still | |
| unsatisfactory. This leads to an important question: can transformers run as fast as MobileNet while obtaining high performance? | |
| To answer this, we first revisit the network architecture and operators used in ViT-based models and identify inefficient designs. | |
| Then we introduce a dimension-consistent pure transformer (without MobileNet blocks) as a design paradigm. | |
| Finally, we perform latency-driven slimming to get a series of final models dubbed EfficientFormer. | |
| Extensive experiments show the superiority of EfficientFormer in performance and speed on mobile devices. | |
| Our fastest model, EfficientFormer-L1, achieves 79.2% top-1 accuracy on ImageNet-1K with only 1.6 ms inference latency on | |
| iPhone 12 (compiled with CoreML), which { runs as fast as MobileNetV2×1.4 (1.6 ms, 74.7% top-1),} and our largest model, | |
| EfficientFormer-L7, obtains 83.3% accuracy with only 7.0 ms latency. Our work proves that properly designed transformers can | |
| reach extremely low latency on mobile devices while maintaining high performance.</em>`,B,ee,x=`This model was contributed by <a href="https://huggingface.co/novice03" rel="nofollow">novice03</a> and <a href="https://huggingface.co/Bearnardd" rel="nofollow">Bearnardd</a>. | |
| The original code can be found <a href="https://github.com/snap-research/EfficientFormer" rel="nofollow">here</a>. The TensorFlow version of this model was added by <a href="https://huggingface.co/D-Roberts" rel="nofollow">D-Roberts</a>.`,L,me,Q,ye,ze='<li><a href="../tasks/image_classification">Image classification task guide</a></li>',D,Te,We,W,k,Ie,q,Ne=`This is the configuration class to store the configuration of an <a href="/docs/transformers/pr_32189/en/model_doc/efficientformer#transformers.EfficientFormerModel">EfficientFormerModel</a>. It is used to | |
| instantiate an EfficientFormer 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 EfficientFormer | |
| <a href="https://huggingface.co/snap-research/efficientformer-l1" rel="nofollow">snap-research/efficientformer-l1</a> architecture.`,xe,V,Ve=`Configuration objects inherit from <a href="/docs/transformers/pr_32189/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the | |
| documentation from <a href="/docs/transformers/pr_32189/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,R,A,X,te,j,J,fe,oe,je,ke="Constructs a EfficientFormer image processor.",Y,pe,O,Fe,we,S="Preprocess an image or batch of images.",U,H,he,ne,Ze,K,re;return g=new Je({props:{title:"EfficientFormer",local:"efficientformer",headingTag:"h1"}}),v=new Re({props:{warning:!0,$$slots:{default:[Ae]},$$scope:{ctx:E}}}),I=new Je({props:{title:"Overview",local:"overview",headingTag:"h2"}}),me=new Je({props:{title:"Documentation resources",local:"documentation-resources",headingTag:"h2"}}),Te=new Je({props:{title:"EfficientFormerConfig",local:"transformers.EfficientFormerConfig",headingTag:"h2"}}),k=new ge({props:{name:"class transformers.EfficientFormerConfig",anchor:"transformers.EfficientFormerConfig",parameters:[{name:"depths",val:": List = [3, 2, 6, 4]"},{name:"hidden_sizes",val:": List = [48, 96, 224, 448]"},{name:"downsamples",val:": List = [True, True, True, True]"},{name:"dim",val:": int = 448"},{name:"key_dim",val:": int = 32"},{name:"attention_ratio",val:": int = 4"},{name:"resolution",val:": int = 7"},{name:"num_hidden_layers",val:": int = 5"},{name:"num_attention_heads",val:": int = 8"},{name:"mlp_expansion_ratio",val:": int = 4"},{name:"hidden_dropout_prob",val:": float = 0.0"},{name:"patch_size",val:": int = 16"},{name:"num_channels",val:": int = 3"},{name:"pool_size",val:": int = 3"},{name:"downsample_patch_size",val:": int = 3"},{name:"downsample_stride",val:": int = 2"},{name:"downsample_pad",val:": int = 1"},{name:"drop_path_rate",val:": float = 0.0"},{name:"num_meta3d_blocks",val:": int = 1"},{name:"distillation",val:": bool = True"},{name:"use_layer_scale",val:": bool = True"},{name:"layer_scale_init_value",val:": float = 1e-05"},{name:"hidden_act",val:": str = 'gelu'"},{name:"initializer_range",val:": float = 0.02"},{name:"layer_norm_eps",val:": float = 1e-12"},{name:"image_size",val:": int = 224"},{name:"batch_norm_eps",val:": float = 1e-05"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerConfig.depths",description:`<strong>depths</strong> (<code>List(int)</code>, <em>optional</em>, defaults to <code>[3, 2, 6, 4]</code>) — | |
| Depth of each stage.`,name:"depths"},{anchor:"transformers.EfficientFormerConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List(int)</code>, <em>optional</em>, defaults to <code>[48, 96, 224, 448]</code>) — | |
| Dimensionality of each stage.`,name:"hidden_sizes"},{anchor:"transformers.EfficientFormerConfig.downsamples",description:`<strong>downsamples</strong> (<code>List(bool)</code>, <em>optional</em>, defaults to <code>[True, True, True, True]</code>) — | |
| Whether or not to downsample inputs between two stages.`,name:"downsamples"},{anchor:"transformers.EfficientFormerConfig.dim",description:`<strong>dim</strong> (<code>int</code>, <em>optional</em>, defaults to 448) — | |
| Number of channels in Meta3D layers`,name:"dim"},{anchor:"transformers.EfficientFormerConfig.key_dim",description:`<strong>key_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 32) — | |
| The size of the key in meta3D block.`,name:"key_dim"},{anchor:"transformers.EfficientFormerConfig.attention_ratio",description:`<strong>attention_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) — | |
| Ratio of the dimension of the query and value to the dimension of the key in MSHA block`,name:"attention_ratio"},{anchor:"transformers.EfficientFormerConfig.resolution",description:`<strong>resolution</strong> (<code>int</code>, <em>optional</em>, defaults to 7) — | |
| Size of each patch`,name:"resolution"},{anchor:"transformers.EfficientFormerConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 5) — | |
| Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.EfficientFormerConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 8) — | |
| Number of attention heads for each attention layer in the 3D MetaBlock.`,name:"num_attention_heads"},{anchor:"transformers.EfficientFormerConfig.mlp_expansion_ratio",description:`<strong>mlp_expansion_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) — | |
| Ratio of size of the hidden dimensionality of an MLP to the dimensionality of its input.`,name:"mlp_expansion_ratio"},{anchor:"transformers.EfficientFormerConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) — | |
| The dropout probability for all fully connected layers in the embeddings and encoder.`,name:"hidden_dropout_prob"},{anchor:"transformers.EfficientFormerConfig.patch_size",description:`<strong>patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 16) — | |
| The size (resolution) of each patch.`,name:"patch_size"},{anchor:"transformers.EfficientFormerConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| The number of input channels.`,name:"num_channels"},{anchor:"transformers.EfficientFormerConfig.pool_size",description:`<strong>pool_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| Kernel size of pooling layers.`,name:"pool_size"},{anchor:"transformers.EfficientFormerConfig.downsample_patch_size",description:`<strong>downsample_patch_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3) — | |
| The size of patches in downsampling layers.`,name:"downsample_patch_size"},{anchor:"transformers.EfficientFormerConfig.downsample_stride",description:`<strong>downsample_stride</strong> (<code>int</code>, <em>optional</em>, defaults to 2) — | |
| The stride of convolution kernels in downsampling layers.`,name:"downsample_stride"},{anchor:"transformers.EfficientFormerConfig.downsample_pad",description:`<strong>downsample_pad</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| Padding in downsampling layers.`,name:"downsample_pad"},{anchor:"transformers.EfficientFormerConfig.drop_path_rate",description:`<strong>drop_path_rate</strong> (<code>int</code>, <em>optional</em>, defaults to 0) — | |
| Rate at which to increase dropout probability in DropPath.`,name:"drop_path_rate"},{anchor:"transformers.EfficientFormerConfig.num_meta3d_blocks",description:`<strong>num_meta3d_blocks</strong> (<code>int</code>, <em>optional</em>, defaults to 1) — | |
| The number of 3D MetaBlocks in the last stage.`,name:"num_meta3d_blocks"},{anchor:"transformers.EfficientFormerConfig.distillation",description:`<strong>distillation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to add a distillation head.`,name:"distillation"},{anchor:"transformers.EfficientFormerConfig.use_layer_scale",description:`<strong>use_layer_scale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to scale outputs from token mixers.`,name:"use_layer_scale"},{anchor:"transformers.EfficientFormerConfig.layer_scale_init_value",description:`<strong>layer_scale_init_value</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-5) — | |
| Factor by which outputs from token mixers are scaled.`,name:"layer_scale_init_value"},{anchor:"transformers.EfficientFormerConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>"gelu"</code>) — | |
| The non-linear activation function (function or string) in the encoder and pooler. If string, <code>"gelu"</code>, | |
| <code>"relu"</code>, <code>"selu"</code> and <code>"gelu_new"</code> are supported.`,name:"hidden_act"},{anchor:"transformers.EfficientFormerConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) — | |
| The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.EfficientFormerConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) — | |
| The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.EfficientFormerConfig.image_size",description:`<strong>image_size</strong> (<code>int</code>, <em>optional</em>, defaults to <code>224</code>) — | |
| The size (resolution) of each image.`,name:"image_size"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/configuration_efficientformer.py#L26"}}),A=new Ge({props:{anchor:"transformers.EfficientFormerConfig.example",$$slots:{default:[Oe]},$$scope:{ctx:E}}}),te=new Je({props:{title:"EfficientFormerImageProcessor",local:"transformers.EfficientFormerImageProcessor",headingTag:"h2"}}),fe=new ge({props:{name:"class transformers.EfficientFormerImageProcessor",anchor:"transformers.EfficientFormerImageProcessor",parameters:[{name:"do_resize",val:": bool = True"},{name:"size",val:": Optional = None"},{name:"resample",val:": Resampling = <Resampling.BICUBIC: 3>"},{name:"do_center_crop",val:": bool = True"},{name:"do_rescale",val:": bool = True"},{name:"rescale_factor",val:": Union = 0.00392156862745098"},{name:"crop_size",val:": Dict = None"},{name:"do_normalize",val:": bool = True"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerImageProcessor.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to resize the image’s (height, width) dimensions to the specified <code>(size["height"], size["width"])</code>. Can be overridden by the <code>do_resize</code> parameter in the <code>preprocess</code> method.`,name:"do_resize"},{anchor:"transformers.EfficientFormerImageProcessor.size",description:`<strong>size</strong> (<code>dict</code>, <em>optional</em>, defaults to <code>{"height" -- 224, "width": 224}</code>): | |
| Size of the output image after resizing. Can be overridden by the <code>size</code> parameter in the <code>preprocess</code> | |
| method.`,name:"size"},{anchor:"transformers.EfficientFormerImageProcessor.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code>, <em>optional</em>, defaults to <code>PILImageResampling.BILINEAR</code>) — | |
| Resampling filter to use if resizing the image. Can be overridden by the <code>resample</code> parameter in the | |
| <code>preprocess</code> method.`,name:"resample"},{anchor:"transformers.EfficientFormerImageProcessor.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| Whether to center crop the image to the specified <code>crop_size</code>. Can be overridden by <code>do_center_crop</code> in the | |
| <code>preprocess</code> method.`,name:"do_center_crop"},{anchor:"transformers.EfficientFormerImageProcessor.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code> <em>optional</em>, defaults to 224) — | |
| Size of the output image after applying <code>center_crop</code>. Can be overridden by <code>crop_size</code> in the <code>preprocess</code> | |
| method.`,name:"crop_size"},{anchor:"transformers.EfficientFormerImageProcessor.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) — | |
| 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.EfficientFormerImageProcessor.rescale_factor",description:`<strong>rescale_factor</strong> (<code>int</code> or <code>float</code>, <em>optional</em>, defaults to <code>1/255</code>) — | |
| Scale factor to use if rescaling the image. Can be overridden by the <code>rescale_factor</code> parameter in the | |
| <code>preprocess</code> method. | |
| do_normalize — | |
| Whether to normalize the image. Can be overridden by the <code>do_normalize</code> parameter in the <code>preprocess</code> | |
| method.`,name:"rescale_factor"},{anchor:"transformers.EfficientFormerImageProcessor.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>) — | |
| 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.EfficientFormerImageProcessor.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>) — | |
| 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"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/image_processing_efficientformer.py#L47"}}),O=new ge({props:{name:"preprocess",anchor:"transformers.EfficientFormerImageProcessor.preprocess",parameters:[{name:"images",val:": Union"},{name:"do_resize",val:": Optional = None"},{name:"size",val:": Dict = None"},{name:"resample",val:": Resampling = None"},{name:"do_center_crop",val:": bool = None"},{name:"crop_size",val:": int = None"},{name:"do_rescale",val:": Optional = None"},{name:"rescale_factor",val:": Optional = None"},{name:"do_normalize",val:": Optional = None"},{name:"image_mean",val:": Union = None"},{name:"image_std",val:": Union = None"},{name:"return_tensors",val:": Union = None"},{name:"data_format",val:": Union = <ChannelDimension.FIRST: 'channels_first'>"},{name:"input_data_format",val:": Union = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.EfficientFormerImageProcessor.preprocess.images",description:`<strong>images</strong> (<code>ImageInput</code>) — | |
| Image to preprocess. Expects a single or batch of images with pixel values ranging from 0 to 255. If | |
| passing in images with pixel values between 0 and 1, set <code>do_rescale=False</code>.`,name:"images"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_resize",description:`<strong>do_resize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_resize</code>) — | |
| Whether to resize the image.`,name:"do_resize"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.size",description:`<strong>size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.size</code>) — | |
| Dictionary in the format <code>{"height": h, "width": w}</code> specifying the size of the output image after | |
| resizing.`,name:"size"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.resample",description:`<strong>resample</strong> (<code>PILImageResampling</code> filter, <em>optional</em>, defaults to <code>self.resample</code>) — | |
| <code>PILImageResampling</code> filter to use if resizing the image e.g. <code>PILImageResampling.BILINEAR</code>. Only has | |
| an effect if <code>do_resize</code> is set to <code>True</code>.`,name:"resample"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_center_crop",description:`<strong>do_center_crop</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_center_crop</code>) — | |
| Whether to center crop the image.`,name:"do_center_crop"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_rescale",description:`<strong>do_rescale</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_rescale</code>) — | |
| Whether to rescale the image values between [0 - 1].`,name:"do_rescale"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.rescale_factor",description:`<strong>rescale_factor</strong> (<code>float</code>, <em>optional</em>, defaults to <code>self.rescale_factor</code>) — | |
| Rescale factor to rescale the image by if <code>do_rescale</code> is set to <code>True</code>.`,name:"rescale_factor"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.crop_size",description:`<strong>crop_size</strong> (<code>Dict[str, int]</code>, <em>optional</em>, defaults to <code>self.crop_size</code>) — | |
| Size of the center crop. Only has an effect if <code>do_center_crop</code> is set to <code>True</code>.`,name:"crop_size"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.do_normalize",description:`<strong>do_normalize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>self.do_normalize</code>) — | |
| Whether to normalize the image.`,name:"do_normalize"},{anchor:"transformers.EfficientFormerImageProcessor.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>) — | |
| Image mean to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_mean"},{anchor:"transformers.EfficientFormerImageProcessor.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>) — | |
| Image standard deviation to use if <code>do_normalize</code> is set to <code>True</code>.`,name:"image_std"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <code>TensorType</code>, <em>optional</em>) — | |
| The type of tensors to return. Can be one of:<ul> | |
| <li>Unset: Return a list of <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.TENSORFLOW</code> or <code>'tf'</code>: Return a batch of type <code>tf.Tensor</code>.</li> | |
| <li><code>TensorType.PYTORCH</code> or <code>'pt'</code>: Return a batch of type <code>torch.Tensor</code>.</li> | |
| <li><code>TensorType.NUMPY</code> or <code>'np'</code>: Return a batch of type <code>np.ndarray</code>.</li> | |
| <li><code>TensorType.JAX</code> or <code>'jax'</code>: Return a batch of type <code>jax.numpy.ndarray</code>.</li> | |
| </ul>`,name:"return_tensors"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.data_format",description:`<strong>data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>, defaults to <code>ChannelDimension.FIRST</code>) — | |
| The channel dimension format for the output image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| <li>Unset: Use the channel dimension format of the input image.</li> | |
| </ul>`,name:"data_format"},{anchor:"transformers.EfficientFormerImageProcessor.preprocess.input_data_format",description:`<strong>input_data_format</strong> (<code>ChannelDimension</code> or <code>str</code>, <em>optional</em>) — | |
| The channel dimension format for the input image. If unset, the channel dimension format is inferred | |
| from the input image. Can be one of:<ul> | |
| <li><code>"channels_first"</code> or <code>ChannelDimension.FIRST</code>: image in (num_channels, height, width) format.</li> | |
| <li><code>"channels_last"</code> or <code>ChannelDimension.LAST</code>: image in (height, width, num_channels) format.</li> | |
| <li><code>"none"</code> or <code>ChannelDimension.NONE</code>: image in (height, width) format.</li> | |
| </ul>`,name:"input_data_format"}],source:"https://github.com/huggingface/transformers/blob/vr_32189/src/transformers/models/deprecated/efficientformer/image_processing_efficientformer.py#L178"}}),H=new Qe({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[gt],pytorch:[it]},$$scope:{ctx:E}}}),ne=new De({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/efficientformer.md"}}),{c(){e=p("meta"),m=l(),t=p("p"),r=l(),_(g.$$.fragment),o=l(),_(v.$$.fragment),ve=l(),_(I.$$.fragment),G=l(),ce=p("p"),ce.innerHTML=ie,Ue=l(),de=p("p"),de.textContent=P,Ce=l(),z=p("p"),z.innerHTML=Ee,B=l(),ee=p("p"),ee.innerHTML=x,L=l(),_(me.$$.fragment),Q=l(),ye=p("ul"),ye.innerHTML=ze,D=l(),_(Te.$$.fragment),We=l(),W=p("div"),_(k.$$.fragment),Ie=l(),q=p("p"),q.innerHTML=Ne,xe=l(),V=p("p"),V.innerHTML=Ve,R=l(),_(A.$$.fragment),X=l(),_(te.$$.fragment),j=l(),J=p("div"),_(fe.$$.fragment),oe=l(),je=p("p"),je.textContent=ke,Y=l(),pe=p("div"),_(O.$$.fragment),Fe=l(),we=p("p"),we.textContent=S,U=l(),_(H.$$.fragment),he=l(),_(ne.$$.fragment),Ze=l(),K=p("p"),this.h()},l(n){const u=Se("svelte-u9bgzb",document.head);e=h(u,"META",{name:!0,content:!0}),u.forEach(a),m=c(n),t=h(n,"P",{}),se(t).forEach(a),r=c(n),b(g.$$.fragment,n),o=c(n),b(v.$$.fragment,n),ve=c(n),b(I.$$.fragment,n),G=c(n),ce=h(n,"P",{"data-svelte-h":!0}),C(ce)!=="svelte-48qc0w"&&(ce.innerHTML=ie),Ue=c(n),de=h(n,"P",{"data-svelte-h":!0}),C(de)!=="svelte-vfdo9a"&&(de.textContent=P),Ce=c(n),z=h(n,"P",{"data-svelte-h":!0}),C(z)!=="svelte-1w1hunj"&&(z.innerHTML=Ee),B=c(n),ee=h(n,"P",{"data-svelte-h":!0}),C(ee)!=="svelte-e302oa"&&(ee.innerHTML=x),L=c(n),b(me.$$.fragment,n),Q=c(n),ye=h(n,"UL",{"data-svelte-h":!0}),C(ye)!=="svelte-1f2rorg"&&(ye.innerHTML=ze),D=c(n),b(Te.$$.fragment,n),We=c(n),W=h(n,"DIV",{class:!0});var s=se(W);b(k.$$.fragment,s),Ie=c(s),q=h(s,"P",{"data-svelte-h":!0}),C(q)!=="svelte-5yvr6m"&&(q.innerHTML=Ne),xe=c(s),V=h(s,"P",{"data-svelte-h":!0}),C(V)!=="svelte-1hzvs8n"&&(V.innerHTML=Ve),R=c(s),b(A.$$.fragment,s),s.forEach(a),X=c(n),b(te.$$.fragment,n),j=c(n),J=h(n,"DIV",{class:!0});var $=se(J);b(fe.$$.fragment,$),oe=c($),je=h($,"P",{"data-svelte-h":!0}),C(je)!=="svelte-48xdfc"&&(je.textContent=ke),Y=c($),pe=h($,"DIV",{class:!0});var Z=se(pe);b(O.$$.fragment,Z),Fe=c(Z),we=h(Z,"P",{"data-svelte-h":!0}),C(we)!=="svelte-1x3yxsa"&&(we.textContent=S),Z.forEach(a),$.forEach(a),U=c(n),b(H.$$.fragment,n),he=c(n),b(ne.$$.fragment,n),Ze=c(n),K=h(n,"P",{}),se(K).forEach(a),this.h()},h(){ae(e,"name","hf:doc:metadata"),ae(e,"content",_t),ae(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),ae(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,u){d(document.head,e),f(n,m,u),f(n,t,u),f(n,r,u),y(g,n,u),f(n,o,u),y(v,n,u),f(n,ve,u),y(I,n,u),f(n,G,u),f(n,ce,u),f(n,Ue,u),f(n,de,u),f(n,Ce,u),f(n,z,u),f(n,B,u),f(n,ee,u),f(n,L,u),y(me,n,u),f(n,Q,u),f(n,ye,u),f(n,D,u),y(Te,n,u),f(n,We,u),f(n,W,u),y(k,W,null),d(W,Ie),d(W,q),d(W,xe),d(W,V),d(W,R),y(A,W,null),f(n,X,u),y(te,n,u),f(n,j,u),f(n,J,u),y(fe,J,null),d(J,oe),d(J,je),d(J,Y),d(J,pe),y(O,pe,null),d(pe,Fe),d(pe,we),f(n,U,u),y(H,n,u),f(n,he,u),y(ne,n,u),f(n,Ze,u),f(n,K,u),re=!0},p(n,[u]){const s={};u&2&&(s.$$scope={dirty:u,ctx:n}),v.$set(s);const $={};u&2&&($.$$scope={dirty:u,ctx:n}),A.$set($);const Z={};u&2&&(Z.$$scope={dirty:u,ctx:n}),H.$set(Z)},i(n){re||(T(g.$$.fragment,n),T(v.$$.fragment,n),T(I.$$.fragment,n),T(me.$$.fragment,n),T(Te.$$.fragment,n),T(k.$$.fragment,n),T(A.$$.fragment,n),T(te.$$.fragment,n),T(fe.$$.fragment,n),T(O.$$.fragment,n),T(H.$$.fragment,n),T(ne.$$.fragment,n),re=!0)},o(n){F(g.$$.fragment,n),F(v.$$.fragment,n),F(I.$$.fragment,n),F(me.$$.fragment,n),F(Te.$$.fragment,n),F(k.$$.fragment,n),F(A.$$.fragment,n),F(te.$$.fragment,n),F(fe.$$.fragment,n),F(O.$$.fragment,n),F(H.$$.fragment,n),F(ne.$$.fragment,n),re=!1},d(n){n&&(a(m),a(t),a(r),a(o),a(ve),a(G),a(ce),a(Ue),a(de),a(Ce),a(z),a(B),a(ee),a(L),a(Q),a(ye),a(D),a(We),a(W),a(X),a(j),a(J),a(U),a(he),a(Ze),a(K)),a(e),w(g,n),w(v,n),w(I,n),w(me,n),w(Te,n),w(k),w(A),w(te,n),w(fe),w(O),w(H,n),w(ne,n)}}}const _t='{"title":"EfficientFormer","local":"efficientformer","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Documentation resources","local":"documentation-resources","sections":[],"depth":2},{"title":"EfficientFormerConfig","local":"transformers.EfficientFormerConfig","sections":[],"depth":2},{"title":"EfficientFormerImageProcessor","local":"transformers.EfficientFormerImageProcessor","sections":[],"depth":2},{"title":"EfficientFormerModel","local":"transformers.EfficientFormerModel","sections":[],"depth":2},{"title":"EfficientFormerForImageClassification","local":"transformers.EfficientFormerForImageClassification","sections":[],"depth":2},{"title":"EfficientFormerForImageClassificationWithTeacher","local":"transformers.EfficientFormerForImageClassificationWithTeacher","sections":[],"depth":2},{"title":"TFEfficientFormerModel","local":"transformers.TFEfficientFormerModel","sections":[],"depth":2},{"title":"TFEfficientFormerForImageClassification","local":"transformers.TFEfficientFormerForImageClassification","sections":[],"depth":2},{"title":"TFEfficientFormerForImageClassificationWithTeacher","local":"transformers.TFEfficientFormerForImageClassificationWithTeacher","sections":[],"depth":2}],"depth":1}';function bt(E){return Xe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Et extends He{constructor(e){super(),Ye(this,e,bt,ut,qe,{})}}export{Et as component}; | |
Xet Storage Details
- Size:
- 106 kB
- Xet hash:
- 617290aec1ecd9f3e709e52d1faea34e51534d38b4ffb10bfb11891052f262b4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.