import{S as kd,i as Ad,s as Bd,e as o,k as p,w as b,t as l,M as Pd,c as a,d as s,m as f,a as n,x as w,h as i,b as d,N as zd,G as e,g as _,y as T,q as $,o as M,B as N,v as Vd,L as ss}from"../../chunks/vendor-hf-doc-builder.js";import{T as Zs}from"../../chunks/Tip-hf-doc-builder.js";import{D as k}from"../../chunks/Docstring-hf-doc-builder.js";import{C as os}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as L}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ts}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";import{P as Gd}from"../../chunks/PipelineTag-hf-doc-builder.js";function Xd(R){let c,v,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFJlc05ldENvbmZpZyUyQyUyMFJlc05ldE1vZGVsJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMFJlc05ldCUyMHJlc25ldC01MCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBSZXNOZXRDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMCh3aXRoJTIwcmFuZG9tJTIwd2VpZ2h0cyklMjBmcm9tJTIwdGhlJTIwcmVzbmV0LTUwJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBSZXNOZXRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> ResNetConfig, ResNetModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a ResNet resnet-50 style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = ResNetConfig()

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = ResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tiger cat`}}),{c(){c=o("p"),v=l("Example:"),g=p(),b(u.$$.fragment)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Example:"),h.forEach(s),g=f(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,v),_(r,g,h),T(u,r,h),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Hd(R){let c,v,g,u,y;return{c(){c=o("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(h,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(s)},m(r,h){_(r,c,h),e(c,v),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function Ld(R){let c,v,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMFRGUmVzTmV0TW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMmh1Z2dpbmdmYWNlJTJGY2F0cy1pbWFnZSUyMiklMEFpbWFnZSUyMCUzRCUyMGRhdGFzZXQlNUIlMjJ0ZXN0JTIyJTVEJTVCJTIyaW1hZ2UlMjIlNUQlNUIwJTVEJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBURlJlc05ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJ0ZiUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZSUwQWxpc3QobGFzdF9oaWRkZW5fc3RhdGVzLnNoYXBlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, TFResNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(image, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(model.config.id2label[predicted_label])
tiger cat`}}),{c(){c=o("p"),v=l("Example:"),g=p(),b(u.$$.fragment)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Example:"),h.forEach(s),g=f(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,v),_(r,g,h),T(u,r,h),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function Kd(R){let c,v,g,u,y;return{c(){c=o("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(h,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(s)},m(r,h){_(r,c,h),e(c,v),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function ec(R){let c,v,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhSZXNOZXRNb2RlbCUwQWZyb20lMjBQSUwlMjBpbXBvcnQlMjBJbWFnZSUwQWltcG9ydCUyMHJlcXVlc3RzJTBBJTBBdXJsJTIwJTNEJTIwJTIyaHR0cCUzQSUyRiUyRmltYWdlcy5jb2NvZGF0YXNldC5vcmclMkZ2YWwyMDE3JTJGMDAwMDAwMDM5NzY5LmpwZyUyMiUwQWltYWdlJTIwJTNEJTIwSW1hZ2Uub3BlbihyZXF1ZXN0cy5nZXQodXJsJTJDJTIwc3RyZWFtJTNEVHJ1ZSkucmF3KSUwQWltYWdlX3Byb2Nlc3NvciUyMCUzRCUyMEF1dG9JbWFnZVByb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQW1vZGVsJTIwJTNEJTIwRmxheFJlc05ldE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBaW5wdXRzJTIwJTNEJTIwaW1hZ2VfcHJvY2Vzc29yKGltYWdlcyUzRGltYWdlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxResNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)
<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxResNetModel.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){c=o("p"),v=l("Examples:"),g=p(),b(u.$$.fragment)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Examples:"),h.forEach(s),g=f(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,v),_(r,g,h),T(u,r,h),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function tc(R){let c,v,g,u,y;return{c(){c=o("p"),v=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),y=l(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),g=a(h,"CODE",{});var F=n(g);u=i(F,"Module"),F.forEach(s),y=i(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(s)},m(r,h){_(r,c,h),e(c,v),e(c,g),e(g,u),e(c,y)},d(r){r&&s(c)}}}function sc(R){let c,v,g,u,y;return u=new os({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9JbWFnZVByb2Nlc3NvciUyQyUyMEZsYXhSZXNOZXRGb3JJbWFnZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMFBJTCUyMGltcG9ydCUyMEltYWdlJTBBaW1wb3J0JTIwamF4JTBBaW1wb3J0JTIwcmVxdWVzdHMlMEElMEF1cmwlMjAlM0QlMjAlMjJodHRwJTNBJTJGJTJGaW1hZ2VzLmNvY29kYXRhc2V0Lm9yZyUyRnZhbDIwMTclMkYwMDAwMDAwMzk3NjkuanBnJTIyJTBBaW1hZ2UlMjAlM0QlMjBJbWFnZS5vcGVuKHJlcXVlc3RzLmdldCh1cmwlMkMlMjBzdHJlYW0lM0RUcnVlKS5yYXcpJTBBJTBBaW1hZ2VfcHJvY2Vzc29yJTIwJTNEJTIwQXV0b0ltYWdlUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZyZXNuZXQtNTAlMjIpJTBBbW9kZWwlMjAlM0QlMjBGbGF4UmVzTmV0Rm9ySW1hZ2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGcmVzbmV0LTUwJTIyKSUwQSUwQWlucHV0cyUyMCUzRCUyMGltYWdlX3Byb2Nlc3NvcihpbWFnZXMlM0RpbWFnZSUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIybnAlMjIpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQWxvZ2l0cyUyMCUzRCUyMG91dHB1dHMubG9naXRzJTBBJTBBJTIzJTIwbW9kZWwlMjBwcmVkaWN0cyUyMG9uZSUyMG9mJTIwdGhlJTIwMTAwMCUyMEltYWdlTmV0JTIwY2xhc3NlcyUwQXByZWRpY3RlZF9jbGFzc19pZHglMjAlM0QlMjBqYXgubnVtcHkuYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEFwcmludCglMjJQcmVkaWN0ZWQlMjBjbGFzcyUzQSUyMiUyQyUyMG1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZHguaXRlbSgpJTVEKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoImageProcessor, FlaxResNetForImageClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> jax
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> requests

<span class="hljs-meta">&gt;&gt;&gt; </span>url = <span class="hljs-string">&quot;http://images.cocodataset.org/val2017/000000039769.jpg&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>image = Image.<span class="hljs-built_in">open</span>(requests.get(url, stream=<span class="hljs-literal">True</span>).raw)

<span class="hljs-meta">&gt;&gt;&gt; </span>image_processor = AutoImageProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = FlaxResNetForImageClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/resnet-50&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = image_processor(images=image, return_tensors=<span class="hljs-string">&quot;np&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># model predicts one of the 1000 ImageNet classes</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = jax.numpy.argmax(logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx.item()])`}}),{c(){c=o("p"),v=l("Example:"),g=p(),b(u.$$.fragment)},l(r){c=a(r,"P",{});var h=n(c);v=i(h,"Example:"),h.forEach(s),g=f(r),w(u.$$.fragment,r)},m(r,h){_(r,c,h),e(c,v),_(r,g,h),T(u,r,h),y=!0},p:ss,i(r){y||($(u.$$.fragment,r),y=!0)},o(r){M(u.$$.fragment,r),y=!1},d(r){r&&s(c),r&&s(g),N(u,r)}}}function oc(R){let c,v,g,u,y,r,h,F,Ca,Wo,O,me,Us,Le,Ea,Ws,xa,ko,I,Za,Oe,Ua,Wa,De,ka,Aa,ks,Ba,Pa,As,za,Va,Bs,Ga,Xa,Ao,as,Qa,Bo,ns,Sa,Po,rs,Ps,Ya,zo,ls,qa,Vo,is,Ke,Ha,ds,La,Oa,Go,ue,Da,et,Ka,en,Xo,tt,si,Qo,A,tn,st,sn,on,ot,an,nn,at,rn,ln,So,D,ge,zs,nt,dn,Vs,cn,Yo,cs,pn,qo,rt,Ho,_e,H,ps,fn,hn,lt,mn,un,it,gn,_n,yn,fs,vn,hs,bn,Lo,ms,wn,Oo,K,ye,Gs,dt,Tn,Xs,$n,Do,Z,ct,Mn,ee,Nn,us,Rn,Fn,pt,jn,Jn,In,te,Cn,gs,En,xn,_s,Zn,Un,Wn,ve,Ko,se,be,Qs,ft,kn,Ss,An,ea,Q,ht,Bn,mt,Pn,ut,zn,Vn,Gn,B,gt,Xn,oe,Qn,ys,Sn,Yn,Ys,qn,Hn,Ln,we,On,Te,ta,ae,$e,qs,_t,Dn,Hs,Kn,sa,U,yt,er,Ls,tr,sr,vt,or,bt,ar,nr,rr,P,wt,lr,ne,ir,vs,dr,cr,Os,pr,fr,hr,Me,mr,Ne,oa,re,Re,Ds,Tt,ur,Ks,gr,aa,S,$t,_r,Mt,yr,Nt,vr,br,wr,z,Rt,Tr,le,$r,bs,Mr,Nr,eo,Rr,Fr,jr,Fe,Jr,je,na,ie,Je,to,Ft,Ir,so,Cr,ra,W,jt,Er,oo,xr,Zr,Jt,Ur,It,Wr,kr,Ar,V,Ct,Br,de,Pr,ws,zr,Vr,ao,Gr,Xr,Qr,Ie,Sr,Ce,la,ce,Ee,no,Et,Yr,ro,qr,ia,j,xt,Hr,lo,Lr,Or,Zt,Dr,Ts,Kr,el,tl,Ut,sl,Wt,ol,al,nl,io,rl,ll,Y,co,kt,il,dl,po,At,cl,pl,fo,Bt,fl,hl,ho,Pt,ml,ul,G,zt,gl,pe,_l,mo,yl,vl,uo,bl,wl,Tl,xe,$l,Ze,da,fe,Ue,go,Vt,Ml,_o,Nl,ca,J,Gt,Rl,yo,Fl,jl,Xt,Jl,$s,Il,Cl,El,Qt,xl,St,Zl,Ul,Wl,vo,kl,Al,q,bo,Yt,Bl,Pl,wo,qt,zl,Vl,To,Ht,Gl,Xl,$o,Lt,Ql,Sl,X,Ot,Yl,he,ql,Mo,Hl,Ll,No,Ol,Dl,Kl,We,ei,ke,pa;return r=new L({}),Le=new L({}),nt=new L({}),rt=new Gd({props:{pipeline:"image-classification"}}),dt=new L({}),ct=new k({props:{name:"class transformers.ResNetConfig",anchor:"transformers.ResNetConfig",parameters:[{name:"num_channels",val:" = 3"},{name:"embedding_size",val:" = 64"},{name:"hidden_sizes",val:" = [256, 512, 1024, 2048]"},{name:"depths",val:" = [3, 4, 6, 3]"},{name:"layer_type",val:" = 'bottleneck'"},{name:"hidden_act",val:" = 'relu'"},{name:"downsample_in_first_stage",val:" = False"},{name:"out_features",val:" = None"},{name:"out_indices",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.ResNetConfig.num_channels",description:`<strong>num_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 3) &#x2014;
The number of input channels.`,name:"num_channels"},{anchor:"transformers.ResNetConfig.embedding_size",description:`<strong>embedding_size</strong> (<code>int</code>, <em>optional</em>, defaults to 64) &#x2014;
Dimensionality (hidden size) for the embedding layer.`,name:"embedding_size"},{anchor:"transformers.ResNetConfig.hidden_sizes",description:`<strong>hidden_sizes</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[256, 512, 1024, 2048]</code>) &#x2014;
Dimensionality (hidden size) at each stage.`,name:"hidden_sizes"},{anchor:"transformers.ResNetConfig.depths",description:`<strong>depths</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[3, 4, 6, 3]</code>) &#x2014;
Depth (number of layers) for each stage.`,name:"depths"},{anchor:"transformers.ResNetConfig.layer_type",description:`<strong>layer_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;bottleneck&quot;</code>) &#x2014;
The layer to use, it can be either <code>&quot;basic&quot;</code> (used for smaller models, like resnet-18 or resnet-34) or
<code>&quot;bottleneck&quot;</code> (used for larger models like resnet-50 and above).`,name:"layer_type"},{anchor:"transformers.ResNetConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;relu&quot;</code>) &#x2014;
The non-linear activation function in each block. If string, <code>&quot;gelu&quot;</code>, <code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code>
are supported.`,name:"hidden_act"},{anchor:"transformers.ResNetConfig.downsample_in_first_stage",description:`<strong>downsample_in_first_stage</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
If <code>True</code>, the first stage will downsample the inputs using a <code>stride</code> of 2.`,name:"downsample_in_first_stage"},{anchor:"transformers.ResNetConfig.out_features",description:`<strong>out_features</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of features to output. Can be any of <code>&quot;stem&quot;</code>, <code>&quot;stage1&quot;</code>, <code>&quot;stage2&quot;</code>, etc.
(depending on how many stages the model has). If unset and <code>out_indices</code> is set, will default to the
corresponding stages. If unset and <code>out_indices</code> is unset, will default to the last stage.`,name:"out_features"},{anchor:"transformers.ResNetConfig.out_indices",description:`<strong>out_indices</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
If used as backbone, list of indices of features to output. Can be any of 0, 1, 2, etc. (depending on how
many stages the model has). If unset and <code>out_features</code> is set, will default to the corresponding stages.
If unset and <code>out_features</code> is unset, will default to the last stage.`,name:"out_indices"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/configuration_resnet.py#L35"}}),ve=new ts({props:{anchor:"transformers.ResNetConfig.example",$$slots:{default:[Xd]},$$scope:{ctx:R}}}),ft=new L({}),ht=new k({props:{name:"class transformers.ResNetModel",anchor:"transformers.ResNetModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_resnet.py#L303"}}),gt=new k({props:{name:"forward",anchor:"transformers.ResNetModel.forward",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ResNetModel.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ResNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_resnet.py#L313",returnDescription:`
<p>A <code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),we=new Zs({props:{$$slots:{default:[Qd]},$$scope:{ctx:R}}}),Te=new ts({props:{anchor:"transformers.ResNetModel.forward.example",$$slots:{default:[Sd]},$$scope:{ctx:R}}}),_t=new L({}),yt=new k({props:{name:"class transformers.ResNetForImageClassification",anchor:"transformers.ResNetForImageClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.ResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_resnet.py#L356"}}),wt=new k({props:{name:"forward",anchor:"transformers.ResNetForImageClassification.forward",parameters:[{name:"pixel_values",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.ResNetForImageClassification.forward.pixel_values",description:`<strong>pixel_values</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.ResNetForImageClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.ResNetForImageClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.ResNetForImageClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_resnet.py#L369",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Me=new Zs({props:{$$slots:{default:[Yd]},$$scope:{ctx:R}}}),Ne=new ts({props:{anchor:"transformers.ResNetForImageClassification.forward.example",$$slots:{default:[qd]},$$scope:{ctx:R}}}),Tt=new L({}),$t=new k({props:{name:"class transformers.TFResNetModel",anchor:"transformers.TFResNetModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_tf_resnet.py#L372"}}),Rt=new k({props:{name:"call",anchor:"transformers.TFResNetModel.call",parameters:[{name:"pixel_values",val:": Tensor"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetModel.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetModel.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFResNetModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_tf_resnet.py#L377",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</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/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(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>) \u2014 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 layer) of shape <code>(batch_size, num_channels, height, width)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFBaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Fe=new Zs({props:{$$slots:{default:[Hd]},$$scope:{ctx:R}}}),je=new ts({props:{anchor:"transformers.TFResNetModel.call.example",$$slots:{default:[Ld]},$$scope:{ctx:R}}}),Ft=new L({}),jt=new k({props:{name:"class transformers.TFResNetForImageClassification",anchor:"transformers.TFResNetForImageClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.TFPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_tf_resnet.py#L414"}}),Ct=new k({props:{name:"call",anchor:"transformers.TFResNetForImageClassification.call",parameters:[{name:"pixel_values",val:": Tensor = None"},{name:"labels",val:": Tensor = None"},{name:"output_hidden_states",val:": bool = None"},{name:"return_dict",val:": bool = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFResNetForImageClassification.call.pixel_values",description:`<strong>pixel_values</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_channels, height, width)</code>) &#x2014;
Pixel values. Pixel values can be obtained using <a href="/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.32.0/en/model_doc/donut#transformers.DonutFeatureExtractor.__call__">ConvNextImageProcessor.<strong>call</strong>()</a> for details.`,name:"pixel_values"},{anchor:"transformers.TFResNetForImageClassification.call.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.TFResNetForImageClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.32.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFResNetForImageClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the image classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_tf_resnet.py#L431",returnDescription:`
<p>A <code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</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/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig"
>ResNetConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</li>
<li><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(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>) \u2014 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, num_channels, height, width)</code>. Hidden-states (also called
feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_tf_outputs.TFImageClassifierOutputWithNoAttention</code> or <code>tuple(tf.Tensor)</code></p>
`}}),Ie=new Zs({props:{$$slots:{default:[Od]},$$scope:{ctx:R}}}),Ce=new ts({props:{anchor:"transformers.TFResNetForImageClassification.call.example",$$slots:{default:[Dd]},$$scope:{ctx:R}}}),Et=new L({}),xt=new k({props:{name:"class transformers.FlaxResNetModel",anchor:"transformers.FlaxResNetModel",parameters:[{name:"config",val:": ResNetConfig"},{name:"input_shape",val:" = (1, 224, 224, 3)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxResNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxResNetModel.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_flax_resnet.py#L580"}}),zt=new k({props:{name:"__call__",anchor:"transformers.FlaxResNetModel.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"train",val:": bool = False"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_flax_resnet.py#L488",returnDescription:`
<p>A <code>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPoolingAndNoAttention</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 (<code>&lt;class 'transformers.models.resnet.configuration_resnet.ResNetConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>last_hidden_state</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, num_channels, height, width)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</li>
<li><strong>pooler_output</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state after a pooling operation on the spatial dimensions.</li>
<li><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings, if the model has an embedding layer, + one
for the output of each layer) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states of the
model at the output of each layer plus the optional initial embedding outputs.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_flax_outputs.FlaxBaseModelOutputWithPoolingAndNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xe=new Zs({props:{$$slots:{default:[Kd]},$$scope:{ctx:R}}}),Ze=new ts({props:{anchor:"transformers.FlaxResNetModel.__call__.example",$$slots:{default:[ec]},$$scope:{ctx:R}}}),Vt=new L({}),Gt=new k({props:{name:"class transformers.FlaxResNetForImageClassification",anchor:"transformers.FlaxResNetForImageClassification",parameters:[{name:"config",val:": ResNetConfig"},{name:"input_shape",val:" = (1, 224, 224, 3)"},{name:"seed",val:": int = 0"},{name:"dtype",val:": dtype = <class 'jax.numpy.float32'>"},{name:"_do_init",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.FlaxResNetForImageClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetConfig">ResNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.FlaxResNetForImageClassification.dtype",description:`<strong>dtype</strong> (<code>jax.numpy.dtype</code>, <em>optional</em>, defaults to <code>jax.numpy.float32</code>) &#x2014;
The data type of the computation. Can be one of <code>jax.numpy.float32</code>, <code>jax.numpy.float16</code> (on GPUs) and
<code>jax.numpy.bfloat16</code> (on TPUs).</p>
<p>This can be used to enable mixed-precision training or half-precision inference on GPUs or TPUs. If
specified all the computation will be performed with the given <code>dtype</code>.</p>
<p><strong>Note that this only specifies the dtype of the computation and does not influence the dtype of model
parameters.</strong></p>
<p>If you wish to change the dtype of the model parameters, see <a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_flax_resnet.py#L667"}}),Ot=new k({props:{name:"__call__",anchor:"transformers.FlaxResNetForImageClassification.__call__",parameters:[{name:"pixel_values",val:""},{name:"params",val:": dict = None"},{name:"train",val:": bool = False"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.32.0/src/transformers/models/resnet/modeling_flax_resnet.py#L488",returnDescription:`
<p>A <code>transformers.modeling_flax_outputs.FlaxImageClassifierOutputWithNoAttention</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 (<code>&lt;class 'transformers.models.resnet.configuration_resnet.ResNetConfig'&gt;</code>) and inputs.</p>
<ul>
<li><strong>logits</strong> (<code>jnp.ndarray</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</li>
<li><strong>hidden_states</strong> (<code>tuple(jnp.ndarray)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when</li>
<li><strong><code>config.output_hidden_states=True</code>):</strong>
Tuple of <code>jnp.ndarray</code> (one for the output of the embeddings, if the model has an embedding layer, + one
for the output of each stage) of shape <code>(batch_size, num_channels, height, width)</code>. Hidden-states (also
called feature maps) of the model at the output of each stage.</li>
</ul>
`,returnType:`
<p><code>transformers.modeling_flax_outputs.FlaxImageClassifierOutputWithNoAttention</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),We=new Zs({props:{$$slots:{default:[tc]},$$scope:{ctx:R}}}),ke=new ts({props:{anchor:"transformers.FlaxResNetForImageClassification.__call__.example",$$slots:{default:[sc]},$$scope:{ctx:R}}}),{c(){c=o("meta"),v=p(),g=o("h1"),u=o("a"),y=o("span"),b(r.$$.fragment),h=p(),F=o("span"),Ca=l("ResNet"),Wo=p(),O=o("h2"),me=o("a"),Us=o("span"),b(Le.$$.fragment),Ea=p(),Ws=o("span"),xa=l("Overview"),ko=p(),I=o("p"),Za=l("The ResNet model was proposed in "),Oe=o("a"),Ua=l("Deep Residual Learning for Image Recognition"),Wa=l(" by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),De=o("a"),ka=l("Nvidia"),Aa=l(", we apply the "),ks=o("code"),Ba=l("stride=2"),Pa=l(" for downsampling in bottleneck\u2019s "),As=o("code"),za=l("3x3"),Va=l(" conv and not in the first "),Bs=o("code"),Ga=l("1x1"),Xa=l(". This is generally known as \u201CResNet v1.5\u201D."),Ao=p(),as=o("p"),Qa=l("ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),Bo=p(),ns=o("p"),Sa=l("The abstract from the paper is the following:"),Po=p(),rs=o("p"),Ps=o("em"),Ya=l(`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),zo=p(),ls=o("p"),qa=l("Tips:"),Vo=p(),is=o("ul"),Ke=o("li"),Ha=l("One can use "),ds=o("a"),La=l("AutoImageProcessor"),Oa=l(" to prepare images for the model."),Go=p(),ue=o("p"),Da=l("The figure below illustrates the architecture of ResNet. Taken from the "),et=o("a"),Ka=l("original paper"),en=l("."),Xo=p(),tt=o("img"),Qo=p(),A=o("p"),tn=l("This model was contributed by "),st=o("a"),sn=l("Francesco"),on=l(". The TensorFlow version of this model was added by "),ot=o("a"),an=l("amyeroberts"),nn=l(". The original code can be found "),at=o("a"),rn=l("here"),ln=l("."),So=p(),D=o("h2"),ge=o("a"),zs=o("span"),b(nt.$$.fragment),dn=p(),Vs=o("span"),cn=l("Resources"),Yo=p(),cs=o("p"),pn=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),qo=p(),b(rt.$$.fragment),Ho=p(),_e=o("ul"),H=o("li"),ps=o("a"),fn=l("ResNetForImageClassification"),hn=l(" is supported by this "),lt=o("a"),mn=l("example script"),un=l(" and "),it=o("a"),gn=l("notebook"),_n=l("."),yn=p(),fs=o("li"),vn=l("See also: "),hs=o("a"),bn=l("Image classification task guide"),Lo=p(),ms=o("p"),wn=l("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),Oo=p(),K=o("h2"),ye=o("a"),Gs=o("span"),b(dt.$$.fragment),Tn=p(),Xs=o("span"),$n=l("ResNetConfig"),Do=p(),Z=o("div"),b(ct.$$.fragment),Mn=p(),ee=o("p"),Nn=l("This is the configuration class to store the configuration of a "),us=o("a"),Rn=l("ResNetModel"),Fn=l(`. It is used to instantiate an
ResNet 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 ResNet
`),pt=o("a"),jn=l("microsoft/resnet-50"),Jn=l(" architecture."),In=p(),te=o("p"),Cn=l("Configuration objects inherit from "),gs=o("a"),En=l("PretrainedConfig"),xn=l(` and can be used to control the model outputs. Read the
documentation from `),_s=o("a"),Zn=l("PretrainedConfig"),Un=l(" for more information."),Wn=p(),b(ve.$$.fragment),Ko=p(),se=o("h2"),be=o("a"),Qs=o("span"),b(ft.$$.fragment),kn=p(),Ss=o("span"),An=l("ResNetModel"),ea=p(),Q=o("div"),b(ht.$$.fragment),Bn=p(),mt=o("p"),Pn=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=o("a"),zn=l("torch.nn.Module"),Vn=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Gn=p(),B=o("div"),b(gt.$$.fragment),Xn=p(),oe=o("p"),Qn=l("The "),ys=o("a"),Sn=l("ResNetModel"),Yn=l(" forward method, overrides the "),Ys=o("code"),qn=l("__call__"),Hn=l(" special method."),Ln=p(),b(we.$$.fragment),On=p(),b(Te.$$.fragment),ta=p(),ae=o("h2"),$e=o("a"),qs=o("span"),b(_t.$$.fragment),Dn=p(),Hs=o("span"),Kn=l("ResNetForImageClassification"),sa=p(),U=o("div"),b(yt.$$.fragment),er=p(),Ls=o("p"),tr=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),sr=p(),vt=o("p"),or=l("This model is a PyTorch "),bt=o("a"),ar=l("torch.nn.Module"),nr=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rr=p(),P=o("div"),b(wt.$$.fragment),lr=p(),ne=o("p"),ir=l("The "),vs=o("a"),dr=l("ResNetForImageClassification"),cr=l(" forward method, overrides the "),Os=o("code"),pr=l("__call__"),fr=l(" special method."),hr=p(),b(Me.$$.fragment),mr=p(),b(Ne.$$.fragment),oa=p(),re=o("h2"),Re=o("a"),Ds=o("span"),b(Tt.$$.fragment),ur=p(),Ks=o("span"),gr=l("TFResNetModel"),aa=p(),S=o("div"),b($t.$$.fragment),_r=p(),Mt=o("p"),yr=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),Nt=o("a"),vr=l("tf.keras.layers.Layer"),br=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),wr=p(),z=o("div"),b(Rt.$$.fragment),Tr=p(),le=o("p"),$r=l("The "),bs=o("a"),Mr=l("TFResNetModel"),Nr=l(" forward method, overrides the "),eo=o("code"),Rr=l("__call__"),Fr=l(" special method."),jr=p(),b(Fe.$$.fragment),Jr=p(),b(je.$$.fragment),na=p(),ie=o("h2"),Je=o("a"),to=o("span"),b(Ft.$$.fragment),Ir=p(),so=o("span"),Cr=l("TFResNetForImageClassification"),ra=p(),W=o("div"),b(jt.$$.fragment),Er=p(),oo=o("p"),xr=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Zr=p(),Jt=o("p"),Ur=l(`This model is a TensorFlow
`),It=o("a"),Wr=l("tf.keras.layers.Layer"),kr=l(` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ar=p(),V=o("div"),b(Ct.$$.fragment),Br=p(),de=o("p"),Pr=l("The "),ws=o("a"),zr=l("TFResNetForImageClassification"),Vr=l(" forward method, overrides the "),ao=o("code"),Gr=l("__call__"),Xr=l(" special method."),Qr=p(),b(Ie.$$.fragment),Sr=p(),b(Ce.$$.fragment),la=p(),ce=o("h2"),Ee=o("a"),no=o("span"),b(Et.$$.fragment),Yr=p(),ro=o("span"),qr=l("FlaxResNetModel"),ia=p(),j=o("div"),b(xt.$$.fragment),Hr=p(),lo=o("p"),Lr=l("The bare ResNet model outputting raw features without any specific head on top."),Or=p(),Zt=o("p"),Dr=l("This model inherits from "),Ts=o("a"),Kr=l("FlaxPreTrainedModel"),el=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),tl=p(),Ut=o("p"),sl=l("This model is also a Flax Linen "),Wt=o("a"),ol=l("flax.linen.Module"),al=l(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),nl=p(),io=o("p"),rl=l("Finally, this model supports inherent JAX features such as:"),ll=p(),Y=o("ul"),co=o("li"),kt=o("a"),il=l("Just-In-Time (JIT) compilation"),dl=p(),po=o("li"),At=o("a"),cl=l("Automatic Differentiation"),pl=p(),fo=o("li"),Bt=o("a"),fl=l("Vectorization"),hl=p(),ho=o("li"),Pt=o("a"),ml=l("Parallelization"),ul=p(),G=o("div"),b(zt.$$.fragment),gl=p(),pe=o("p"),_l=l("The "),mo=o("code"),yl=l("FlaxResNetPreTrainedModel"),vl=l(" forward method, overrides the "),uo=o("code"),bl=l("__call__"),wl=l(" special method."),Tl=p(),b(xe.$$.fragment),$l=p(),b(Ze.$$.fragment),da=p(),fe=o("h2"),Ue=o("a"),go=o("span"),b(Vt.$$.fragment),Ml=p(),_o=o("span"),Nl=l("FlaxResNetForImageClassification"),ca=p(),J=o("div"),b(Gt.$$.fragment),Rl=p(),yo=o("p"),Fl=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),jl=p(),Xt=o("p"),Jl=l("This model inherits from "),$s=o("a"),Il=l("FlaxPreTrainedModel"),Cl=l(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),El=p(),Qt=o("p"),xl=l("This model is also a Flax Linen "),St=o("a"),Zl=l("flax.linen.Module"),Ul=l(`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Wl=p(),vo=o("p"),kl=l("Finally, this model supports inherent JAX features such as:"),Al=p(),q=o("ul"),bo=o("li"),Yt=o("a"),Bl=l("Just-In-Time (JIT) compilation"),Pl=p(),wo=o("li"),qt=o("a"),zl=l("Automatic Differentiation"),Vl=p(),To=o("li"),Ht=o("a"),Gl=l("Vectorization"),Xl=p(),$o=o("li"),Lt=o("a"),Ql=l("Parallelization"),Sl=p(),X=o("div"),b(Ot.$$.fragment),Yl=p(),he=o("p"),ql=l("The "),Mo=o("code"),Hl=l("FlaxResNetPreTrainedModel"),Ll=l(" forward method, overrides the "),No=o("code"),Ol=l("__call__"),Dl=l(" special method."),Kl=p(),b(We.$$.fragment),ei=p(),b(ke.$$.fragment),this.h()},l(t){const m=Pd('[data-svelte="svelte-1phssyn"]',document.head);c=a(m,"META",{name:!0,content:!0}),m.forEach(s),v=f(t),g=a(t,"H1",{class:!0});var Dt=n(g);u=a(Dt,"A",{id:!0,class:!0,href:!0});var Ro=n(u);y=a(Ro,"SPAN",{});var Fo=n(y);w(r.$$.fragment,Fo),Fo.forEach(s),Ro.forEach(s),h=f(Dt),F=a(Dt,"SPAN",{});var jo=n(F);Ca=i(jo,"ResNet"),jo.forEach(s),Dt.forEach(s),Wo=f(t),O=a(t,"H2",{class:!0});var Kt=n(O);me=a(Kt,"A",{id:!0,class:!0,href:!0});var Jo=n(me);Us=a(Jo,"SPAN",{});var Io=n(Us);w(Le.$$.fragment,Io),Io.forEach(s),Jo.forEach(s),Ea=f(Kt),Ws=a(Kt,"SPAN",{});var Co=n(Ws);xa=i(Co,"Overview"),Co.forEach(s),Kt.forEach(s),ko=f(t),I=a(t,"P",{});var C=n(I);Za=i(C,"The ResNet model was proposed in "),Oe=a(C,"A",{href:!0,rel:!0});var Eo=n(Oe);Ua=i(Eo,"Deep Residual Learning for Image Recognition"),Eo.forEach(s),Wa=i(C," by Kaiming He, Xiangyu Zhang, Shaoqing Ren and Jian Sun. Our implementation follows the small changes made by "),De=a(C,"A",{href:!0,rel:!0});var xo=n(De);ka=i(xo,"Nvidia"),xo.forEach(s),Aa=i(C,", we apply the "),ks=a(C,"CODE",{});var Zo=n(ks);Ba=i(Zo,"stride=2"),Zo.forEach(s),Pa=i(C," for downsampling in bottleneck\u2019s "),As=a(C,"CODE",{});var Uo=n(As);za=i(Uo,"3x3"),Uo.forEach(s),Va=i(C," conv and not in the first "),Bs=a(C,"CODE",{});var oi=n(Bs);Ga=i(oi,"1x1"),oi.forEach(s),Xa=i(C,". This is generally known as \u201CResNet v1.5\u201D."),C.forEach(s),Ao=f(t),as=a(t,"P",{});var ai=n(as);Qa=i(ai,"ResNet introduced residual connections, they allow to train networks with an unseen number of layers (up to 1000). ResNet won the 2015 ILSVRC & COCO competition, one important milestone in deep computer vision."),ai.forEach(s),Bo=f(t),ns=a(t,"P",{});var ni=n(ns);Sa=i(ni,"The abstract from the paper is the following:"),ni.forEach(s),Po=f(t),rs=a(t,"P",{});var ri=n(rs);Ps=a(ri,"EM",{});var li=n(Ps);Ya=i(li,`Deeper neural networks are more difficult to train. We present a residual learning framework to ease the training of networks that are substantially deeper than those used previously. We explicitly reformulate the layers as learning residual functions with reference to the layer inputs, instead of learning unreferenced functions. We provide comprehensive empirical evidence showing that these residual networks are easier to optimize, and can gain accuracy from considerably increased depth. On the ImageNet dataset we evaluate residual nets with a depth of up to 152 layers---8x deeper than VGG nets but still having lower complexity. An ensemble of these residual nets achieves 3.57% error on the ImageNet test set. This result won the 1st place on the ILSVRC 2015 classification task. We also present analysis on CIFAR-10 with 100 and 1000 layers.
The depth of representations is of central importance for many visual recognition tasks. Solely due to our extremely deep representations, we obtain a 28% relative improvement on the COCO object detection dataset. Deep residual nets are foundations of our submissions to ILSVRC & COCO 2015 competitions, where we also won the 1st places on the tasks of ImageNet detection, ImageNet localization, COCO detection, and COCO segmentation.`),li.forEach(s),ri.forEach(s),zo=f(t),ls=a(t,"P",{});var ii=n(ls);qa=i(ii,"Tips:"),ii.forEach(s),Vo=f(t),is=a(t,"UL",{});var di=n(is);Ke=a(di,"LI",{});var fa=n(Ke);Ha=i(fa,"One can use "),ds=a(fa,"A",{href:!0});var ci=n(ds);La=i(ci,"AutoImageProcessor"),ci.forEach(s),Oa=i(fa," to prepare images for the model."),fa.forEach(s),di.forEach(s),Go=f(t),ue=a(t,"P",{});var ha=n(ue);Da=i(ha,"The figure below illustrates the architecture of ResNet. Taken from the "),et=a(ha,"A",{href:!0,rel:!0});var pi=n(et);Ka=i(pi,"original paper"),pi.forEach(s),en=i(ha,"."),ha.forEach(s),Xo=f(t),tt=a(t,"IMG",{width:!0,src:!0}),Qo=f(t),A=a(t,"P",{});var Ae=n(A);tn=i(Ae,"This model was contributed by "),st=a(Ae,"A",{href:!0,rel:!0});var fi=n(st);sn=i(fi,"Francesco"),fi.forEach(s),on=i(Ae,". The TensorFlow version of this model was added by "),ot=a(Ae,"A",{href:!0,rel:!0});var hi=n(ot);an=i(hi,"amyeroberts"),hi.forEach(s),nn=i(Ae,". The original code can be found "),at=a(Ae,"A",{href:!0,rel:!0});var mi=n(at);rn=i(mi,"here"),mi.forEach(s),ln=i(Ae,"."),Ae.forEach(s),So=f(t),D=a(t,"H2",{class:!0});var ma=n(D);ge=a(ma,"A",{id:!0,class:!0,href:!0});var ui=n(ge);zs=a(ui,"SPAN",{});var gi=n(zs);w(nt.$$.fragment,gi),gi.forEach(s),ui.forEach(s),dn=f(ma),Vs=a(ma,"SPAN",{});var _i=n(Vs);cn=i(_i,"Resources"),_i.forEach(s),ma.forEach(s),Yo=f(t),cs=a(t,"P",{});var yi=n(cs);pn=i(yi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),yi.forEach(s),qo=f(t),w(rt.$$.fragment,t),Ho=f(t),_e=a(t,"UL",{});var ua=n(_e);H=a(ua,"LI",{});var es=n(H);ps=a(es,"A",{href:!0});var vi=n(ps);fn=i(vi,"ResNetForImageClassification"),vi.forEach(s),hn=i(es," is supported by this "),lt=a(es,"A",{href:!0,rel:!0});var bi=n(lt);mn=i(bi,"example script"),bi.forEach(s),un=i(es," and "),it=a(es,"A",{href:!0,rel:!0});var wi=n(it);gn=i(wi,"notebook"),wi.forEach(s),_n=i(es,"."),es.forEach(s),yn=f(ua),fs=a(ua,"LI",{});var ti=n(fs);vn=i(ti,"See also: "),hs=a(ti,"A",{href:!0});var Ti=n(hs);bn=i(Ti,"Image classification task guide"),Ti.forEach(s),ti.forEach(s),ua.forEach(s),Lo=f(t),ms=a(t,"P",{});var $i=n(ms);wn=i($i,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),$i.forEach(s),Oo=f(t),K=a(t,"H2",{class:!0});var ga=n(K);ye=a(ga,"A",{id:!0,class:!0,href:!0});var Mi=n(ye);Gs=a(Mi,"SPAN",{});var Ni=n(Gs);w(dt.$$.fragment,Ni),Ni.forEach(s),Mi.forEach(s),Tn=f(ga),Xs=a(ga,"SPAN",{});var Ri=n(Xs);$n=i(Ri,"ResNetConfig"),Ri.forEach(s),ga.forEach(s),Do=f(t),Z=a(t,"DIV",{class:!0});var Be=n(Z);w(ct.$$.fragment,Be),Mn=f(Be),ee=a(Be,"P",{});var Ms=n(ee);Nn=i(Ms,"This is the configuration class to store the configuration of a "),us=a(Ms,"A",{href:!0});var Fi=n(us);Rn=i(Fi,"ResNetModel"),Fi.forEach(s),Fn=i(Ms,`. It is used to instantiate an
ResNet 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 ResNet
`),pt=a(Ms,"A",{href:!0,rel:!0});var ji=n(pt);jn=i(ji,"microsoft/resnet-50"),ji.forEach(s),Jn=i(Ms," architecture."),Ms.forEach(s),In=f(Be),te=a(Be,"P",{});var Ns=n(te);Cn=i(Ns,"Configuration objects inherit from "),gs=a(Ns,"A",{href:!0});var Ji=n(gs);En=i(Ji,"PretrainedConfig"),Ji.forEach(s),xn=i(Ns,` and can be used to control the model outputs. Read the
documentation from `),_s=a(Ns,"A",{href:!0});var Ii=n(_s);Zn=i(Ii,"PretrainedConfig"),Ii.forEach(s),Un=i(Ns," for more information."),Ns.forEach(s),Wn=f(Be),w(ve.$$.fragment,Be),Be.forEach(s),Ko=f(t),se=a(t,"H2",{class:!0});var _a=n(se);be=a(_a,"A",{id:!0,class:!0,href:!0});var Ci=n(be);Qs=a(Ci,"SPAN",{});var Ei=n(Qs);w(ft.$$.fragment,Ei),Ei.forEach(s),Ci.forEach(s),kn=f(_a),Ss=a(_a,"SPAN",{});var xi=n(Ss);An=i(xi,"ResNetModel"),xi.forEach(s),_a.forEach(s),ea=f(t),Q=a(t,"DIV",{class:!0});var Rs=n(Q);w(ht.$$.fragment,Rs),Bn=f(Rs),mt=a(Rs,"P",{});var ya=n(mt);Pn=i(ya,`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=a(ya,"A",{href:!0,rel:!0});var Zi=n(ut);zn=i(Zi,"torch.nn.Module"),Zi.forEach(s),Vn=i(ya,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ya.forEach(s),Gn=f(Rs),B=a(Rs,"DIV",{class:!0});var Pe=n(B);w(gt.$$.fragment,Pe),Xn=f(Pe),oe=a(Pe,"P",{});var Fs=n(oe);Qn=i(Fs,"The "),ys=a(Fs,"A",{href:!0});var Ui=n(ys);Sn=i(Ui,"ResNetModel"),Ui.forEach(s),Yn=i(Fs," forward method, overrides the "),Ys=a(Fs,"CODE",{});var Wi=n(Ys);qn=i(Wi,"__call__"),Wi.forEach(s),Hn=i(Fs," special method."),Fs.forEach(s),Ln=f(Pe),w(we.$$.fragment,Pe),On=f(Pe),w(Te.$$.fragment,Pe),Pe.forEach(s),Rs.forEach(s),ta=f(t),ae=a(t,"H2",{class:!0});var va=n(ae);$e=a(va,"A",{id:!0,class:!0,href:!0});var ki=n($e);qs=a(ki,"SPAN",{});var Ai=n(qs);w(_t.$$.fragment,Ai),Ai.forEach(s),ki.forEach(s),Dn=f(va),Hs=a(va,"SPAN",{});var Bi=n(Hs);Kn=i(Bi,"ResNetForImageClassification"),Bi.forEach(s),va.forEach(s),sa=f(t),U=a(t,"DIV",{class:!0});var ze=n(U);w(yt.$$.fragment,ze),er=f(ze),Ls=a(ze,"P",{});var Pi=n(Ls);tr=i(Pi,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Pi.forEach(s),sr=f(ze),vt=a(ze,"P",{});var ba=n(vt);or=i(ba,"This model is a PyTorch "),bt=a(ba,"A",{href:!0,rel:!0});var zi=n(bt);ar=i(zi,"torch.nn.Module"),zi.forEach(s),nr=i(ba,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ba.forEach(s),rr=f(ze),P=a(ze,"DIV",{class:!0});var Ve=n(P);w(wt.$$.fragment,Ve),lr=f(Ve),ne=a(Ve,"P",{});var js=n(ne);ir=i(js,"The "),vs=a(js,"A",{href:!0});var Vi=n(vs);dr=i(Vi,"ResNetForImageClassification"),Vi.forEach(s),cr=i(js," forward method, overrides the "),Os=a(js,"CODE",{});var Gi=n(Os);pr=i(Gi,"__call__"),Gi.forEach(s),fr=i(js," special method."),js.forEach(s),hr=f(Ve),w(Me.$$.fragment,Ve),mr=f(Ve),w(Ne.$$.fragment,Ve),Ve.forEach(s),ze.forEach(s),oa=f(t),re=a(t,"H2",{class:!0});var wa=n(re);Re=a(wa,"A",{id:!0,class:!0,href:!0});var Xi=n(Re);Ds=a(Xi,"SPAN",{});var Qi=n(Ds);w(Tt.$$.fragment,Qi),Qi.forEach(s),Xi.forEach(s),ur=f(wa),Ks=a(wa,"SPAN",{});var Si=n(Ks);gr=i(Si,"TFResNetModel"),Si.forEach(s),wa.forEach(s),aa=f(t),S=a(t,"DIV",{class:!0});var Js=n(S);w($t.$$.fragment,Js),_r=f(Js),Mt=a(Js,"P",{});var Ta=n(Mt);yr=i(Ta,`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),Nt=a(Ta,"A",{href:!0,rel:!0});var Yi=n(Nt);vr=i(Yi,"tf.keras.layers.Layer"),Yi.forEach(s),br=i(Ta,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ta.forEach(s),wr=f(Js),z=a(Js,"DIV",{class:!0});var Ge=n(z);w(Rt.$$.fragment,Ge),Tr=f(Ge),le=a(Ge,"P",{});var Is=n(le);$r=i(Is,"The "),bs=a(Is,"A",{href:!0});var qi=n(bs);Mr=i(qi,"TFResNetModel"),qi.forEach(s),Nr=i(Is," forward method, overrides the "),eo=a(Is,"CODE",{});var Hi=n(eo);Rr=i(Hi,"__call__"),Hi.forEach(s),Fr=i(Is," special method."),Is.forEach(s),jr=f(Ge),w(Fe.$$.fragment,Ge),Jr=f(Ge),w(je.$$.fragment,Ge),Ge.forEach(s),Js.forEach(s),na=f(t),ie=a(t,"H2",{class:!0});var $a=n(ie);Je=a($a,"A",{id:!0,class:!0,href:!0});var Li=n(Je);to=a(Li,"SPAN",{});var Oi=n(to);w(Ft.$$.fragment,Oi),Oi.forEach(s),Li.forEach(s),Ir=f($a),so=a($a,"SPAN",{});var Di=n(so);Cr=i(Di,"TFResNetForImageClassification"),Di.forEach(s),$a.forEach(s),ra=f(t),W=a(t,"DIV",{class:!0});var Xe=n(W);w(jt.$$.fragment,Xe),Er=f(Xe),oo=a(Xe,"P",{});var Ki=n(oo);xr=i(Ki,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Ki.forEach(s),Zr=f(Xe),Jt=a(Xe,"P",{});var Ma=n(Jt);Ur=i(Ma,`This model is a TensorFlow
`),It=a(Ma,"A",{href:!0,rel:!0});var ed=n(It);Wr=i(ed,"tf.keras.layers.Layer"),ed.forEach(s),kr=i(Ma,` sub-class. Use it as a
regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and
behavior.`),Ma.forEach(s),Ar=f(Xe),V=a(Xe,"DIV",{class:!0});var Qe=n(V);w(Ct.$$.fragment,Qe),Br=f(Qe),de=a(Qe,"P",{});var Cs=n(de);Pr=i(Cs,"The "),ws=a(Cs,"A",{href:!0});var td=n(ws);zr=i(td,"TFResNetForImageClassification"),td.forEach(s),Vr=i(Cs," forward method, overrides the "),ao=a(Cs,"CODE",{});var sd=n(ao);Gr=i(sd,"__call__"),sd.forEach(s),Xr=i(Cs," special method."),Cs.forEach(s),Qr=f(Qe),w(Ie.$$.fragment,Qe),Sr=f(Qe),w(Ce.$$.fragment,Qe),Qe.forEach(s),Xe.forEach(s),la=f(t),ce=a(t,"H2",{class:!0});var Na=n(ce);Ee=a(Na,"A",{id:!0,class:!0,href:!0});var od=n(Ee);no=a(od,"SPAN",{});var ad=n(no);w(Et.$$.fragment,ad),ad.forEach(s),od.forEach(s),Yr=f(Na),ro=a(Na,"SPAN",{});var nd=n(ro);qr=i(nd,"FlaxResNetModel"),nd.forEach(s),Na.forEach(s),ia=f(t),j=a(t,"DIV",{class:!0});var E=n(j);w(xt.$$.fragment,E),Hr=f(E),lo=a(E,"P",{});var rd=n(lo);Lr=i(rd,"The bare ResNet model outputting raw features without any specific head on top."),rd.forEach(s),Or=f(E),Zt=a(E,"P",{});var Ra=n(Zt);Dr=i(Ra,"This model inherits from "),Ts=a(Ra,"A",{href:!0});var ld=n(Ts);Kr=i(ld,"FlaxPreTrainedModel"),ld.forEach(s),el=i(Ra,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ra.forEach(s),tl=f(E),Ut=a(E,"P",{});var Fa=n(Ut);sl=i(Fa,"This model is also a Flax Linen "),Wt=a(Fa,"A",{href:!0,rel:!0});var id=n(Wt);ol=i(id,"flax.linen.Module"),id.forEach(s),al=i(Fa,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Fa.forEach(s),nl=f(E),io=a(E,"P",{});var dd=n(io);rl=i(dd,"Finally, this model supports inherent JAX features such as:"),dd.forEach(s),ll=f(E),Y=a(E,"UL",{});var Se=n(Y);co=a(Se,"LI",{});var cd=n(co);kt=a(cd,"A",{href:!0,rel:!0});var pd=n(kt);il=i(pd,"Just-In-Time (JIT) compilation"),pd.forEach(s),cd.forEach(s),dl=f(Se),po=a(Se,"LI",{});var fd=n(po);At=a(fd,"A",{href:!0,rel:!0});var hd=n(At);cl=i(hd,"Automatic Differentiation"),hd.forEach(s),fd.forEach(s),pl=f(Se),fo=a(Se,"LI",{});var md=n(fo);Bt=a(md,"A",{href:!0,rel:!0});var ud=n(Bt);fl=i(ud,"Vectorization"),ud.forEach(s),md.forEach(s),hl=f(Se),ho=a(Se,"LI",{});var gd=n(ho);Pt=a(gd,"A",{href:!0,rel:!0});var _d=n(Pt);ml=i(_d,"Parallelization"),_d.forEach(s),gd.forEach(s),Se.forEach(s),ul=f(E),G=a(E,"DIV",{class:!0});var Ye=n(G);w(zt.$$.fragment,Ye),gl=f(Ye),pe=a(Ye,"P",{});var Es=n(pe);_l=i(Es,"The "),mo=a(Es,"CODE",{});var yd=n(mo);yl=i(yd,"FlaxResNetPreTrainedModel"),yd.forEach(s),vl=i(Es," forward method, overrides the "),uo=a(Es,"CODE",{});var vd=n(uo);bl=i(vd,"__call__"),vd.forEach(s),wl=i(Es," special method."),Es.forEach(s),Tl=f(Ye),w(xe.$$.fragment,Ye),$l=f(Ye),w(Ze.$$.fragment,Ye),Ye.forEach(s),E.forEach(s),da=f(t),fe=a(t,"H2",{class:!0});var ja=n(fe);Ue=a(ja,"A",{id:!0,class:!0,href:!0});var bd=n(Ue);go=a(bd,"SPAN",{});var wd=n(go);w(Vt.$$.fragment,wd),wd.forEach(s),bd.forEach(s),Ml=f(ja),_o=a(ja,"SPAN",{});var Td=n(_o);Nl=i(Td,"FlaxResNetForImageClassification"),Td.forEach(s),ja.forEach(s),ca=f(t),J=a(t,"DIV",{class:!0});var x=n(J);w(Gt.$$.fragment,x),Rl=f(x),yo=a(x,"P",{});var $d=n(yo);Fl=i($d,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),$d.forEach(s),jl=f(x),Xt=a(x,"P",{});var Ja=n(Xt);Jl=i(Ja,"This model inherits from "),$s=a(Ja,"A",{href:!0});var Md=n($s);Il=i(Md,"FlaxPreTrainedModel"),Md.forEach(s),Cl=i(Ja,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading, saving and converting weights from PyTorch models)`),Ja.forEach(s),El=f(x),Qt=a(x,"P",{});var Ia=n(Qt);xl=i(Ia,"This model is also a Flax Linen "),St=a(Ia,"A",{href:!0,rel:!0});var Nd=n(St);Zl=i(Nd,"flax.linen.Module"),Nd.forEach(s),Ul=i(Ia,`
subclass. Use it as a regular Flax linen Module and refer to the Flax documentation for all matter related to
general usage and behavior.`),Ia.forEach(s),Wl=f(x),vo=a(x,"P",{});var Rd=n(vo);kl=i(Rd,"Finally, this model supports inherent JAX features such as:"),Rd.forEach(s),Al=f(x),q=a(x,"UL",{});var qe=n(q);bo=a(qe,"LI",{});var Fd=n(bo);Yt=a(Fd,"A",{href:!0,rel:!0});var jd=n(Yt);Bl=i(jd,"Just-In-Time (JIT) compilation"),jd.forEach(s),Fd.forEach(s),Pl=f(qe),wo=a(qe,"LI",{});var Jd=n(wo);qt=a(Jd,"A",{href:!0,rel:!0});var Id=n(qt);zl=i(Id,"Automatic Differentiation"),Id.forEach(s),Jd.forEach(s),Vl=f(qe),To=a(qe,"LI",{});var Cd=n(To);Ht=a(Cd,"A",{href:!0,rel:!0});var Ed=n(Ht);Gl=i(Ed,"Vectorization"),Ed.forEach(s),Cd.forEach(s),Xl=f(qe),$o=a(qe,"LI",{});var xd=n($o);Lt=a(xd,"A",{href:!0,rel:!0});var Zd=n(Lt);Ql=i(Zd,"Parallelization"),Zd.forEach(s),xd.forEach(s),qe.forEach(s),Sl=f(x),X=a(x,"DIV",{class:!0});var He=n(X);w(Ot.$$.fragment,He),Yl=f(He),he=a(He,"P",{});var xs=n(he);ql=i(xs,"The "),Mo=a(xs,"CODE",{});var Ud=n(Mo);Hl=i(Ud,"FlaxResNetPreTrainedModel"),Ud.forEach(s),Ll=i(xs," forward method, overrides the "),No=a(xs,"CODE",{});var Wd=n(No);Ol=i(Wd,"__call__"),Wd.forEach(s),Dl=i(xs," special method."),xs.forEach(s),Kl=f(He),w(We.$$.fragment,He),ei=f(He),w(ke.$$.fragment,He),He.forEach(s),x.forEach(s),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(ac)),d(u,"id","resnet"),d(u,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(u,"href","#resnet"),d(g,"class","relative group"),d(me,"id","overview"),d(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(me,"href","#overview"),d(O,"class","relative group"),d(Oe,"href","https://arxiv.org/abs/1512.03385"),d(Oe,"rel","nofollow"),d(De,"href","https://catalog.ngc.nvidia.com/orgs/nvidia/resources/resnet_50_v1_5_for_pytorch"),d(De,"rel","nofollow"),d(ds,"href","/docs/transformers/v4.32.0/en/model_doc/auto#transformers.AutoImageProcessor"),d(et,"href","https://arxiv.org/abs/1512.03385"),d(et,"rel","nofollow"),d(tt,"width","600"),zd(tt.src,si="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/resnet_architecture.png")||d(tt,"src",si),d(st,"href","https://huggingface.co/Francesco"),d(st,"rel","nofollow"),d(ot,"href","https://huggingface.co/amyeroberts"),d(ot,"rel","nofollow"),d(at,"href","https://github.com/KaimingHe/deep-residual-networks"),d(at,"rel","nofollow"),d(ge,"id","resources"),d(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ge,"href","#resources"),d(D,"class","relative group"),d(ps,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(lt,"href","https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification"),d(lt,"rel","nofollow"),d(it,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb"),d(it,"rel","nofollow"),d(hs,"href","../tasks/image_classification"),d(ye,"id","transformers.ResNetConfig"),d(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ye,"href","#transformers.ResNetConfig"),d(K,"class","relative group"),d(us,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetModel"),d(pt,"href","https://huggingface.co/microsoft/resnet-50"),d(pt,"rel","nofollow"),d(gs,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(_s,"href","/docs/transformers/v4.32.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(be,"id","transformers.ResNetModel"),d(be,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(be,"href","#transformers.ResNetModel"),d(se,"class","relative group"),d(ut,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ut,"rel","nofollow"),d(ys,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetModel"),d(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d($e,"id","transformers.ResNetForImageClassification"),d($e,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d($e,"href","#transformers.ResNetForImageClassification"),d(ae,"class","relative group"),d(bt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(bt,"rel","nofollow"),d(vs,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.ResNetForImageClassification"),d(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Re,"id","transformers.TFResNetModel"),d(Re,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Re,"href","#transformers.TFResNetModel"),d(re,"class","relative group"),d(Nt,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(Nt,"rel","nofollow"),d(bs,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.TFResNetModel"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Je,"id","transformers.TFResNetForImageClassification"),d(Je,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Je,"href","#transformers.TFResNetForImageClassification"),d(ie,"class","relative group"),d(It,"href","https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer"),d(It,"rel","nofollow"),d(ws,"href","/docs/transformers/v4.32.0/en/model_doc/resnet#transformers.TFResNetForImageClassification"),d(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ee,"id","transformers.FlaxResNetModel"),d(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ee,"href","#transformers.FlaxResNetModel"),d(ce,"class","relative group"),d(Ts,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(Wt,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(Wt,"rel","nofollow"),d(kt,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(kt,"rel","nofollow"),d(At,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(At,"rel","nofollow"),d(Bt,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Bt,"rel","nofollow"),d(Pt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Pt,"rel","nofollow"),d(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Ue,"id","transformers.FlaxResNetForImageClassification"),d(Ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Ue,"href","#transformers.FlaxResNetForImageClassification"),d(fe,"class","relative group"),d($s,"href","/docs/transformers/v4.32.0/en/main_classes/model#transformers.FlaxPreTrainedModel"),d(St,"href","https://flax.readthedocs.io/en/latest/flax.linen.html#module"),d(St,"rel","nofollow"),d(Yt,"href","https://jax.readthedocs.io/en/latest/jax.html#just-in-time-compilation-jit"),d(Yt,"rel","nofollow"),d(qt,"href","https://jax.readthedocs.io/en/latest/jax.html#automatic-differentiation"),d(qt,"rel","nofollow"),d(Ht,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Ht,"rel","nofollow"),d(Lt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Lt,"rel","nofollow"),d(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(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(t,m){e(document.head,c),_(t,v,m),_(t,g,m),e(g,u),e(u,y),T(r,y,null),e(g,h),e(g,F),e(F,Ca),_(t,Wo,m),_(t,O,m),e(O,me),e(me,Us),T(Le,Us,null),e(O,Ea),e(O,Ws),e(Ws,xa),_(t,ko,m),_(t,I,m),e(I,Za),e(I,Oe),e(Oe,Ua),e(I,Wa),e(I,De),e(De,ka),e(I,Aa),e(I,ks),e(ks,Ba),e(I,Pa),e(I,As),e(As,za),e(I,Va),e(I,Bs),e(Bs,Ga),e(I,Xa),_(t,Ao,m),_(t,as,m),e(as,Qa),_(t,Bo,m),_(t,ns,m),e(ns,Sa),_(t,Po,m),_(t,rs,m),e(rs,Ps),e(Ps,Ya),_(t,zo,m),_(t,ls,m),e(ls,qa),_(t,Vo,m),_(t,is,m),e(is,Ke),e(Ke,Ha),e(Ke,ds),e(ds,La),e(Ke,Oa),_(t,Go,m),_(t,ue,m),e(ue,Da),e(ue,et),e(et,Ka),e(ue,en),_(t,Xo,m),_(t,tt,m),_(t,Qo,m),_(t,A,m),e(A,tn),e(A,st),e(st,sn),e(A,on),e(A,ot),e(ot,an),e(A,nn),e(A,at),e(at,rn),e(A,ln),_(t,So,m),_(t,D,m),e(D,ge),e(ge,zs),T(nt,zs,null),e(D,dn),e(D,Vs),e(Vs,cn),_(t,Yo,m),_(t,cs,m),e(cs,pn),_(t,qo,m),T(rt,t,m),_(t,Ho,m),_(t,_e,m),e(_e,H),e(H,ps),e(ps,fn),e(H,hn),e(H,lt),e(lt,mn),e(H,un),e(H,it),e(it,gn),e(H,_n),e(_e,yn),e(_e,fs),e(fs,vn),e(fs,hs),e(hs,bn),_(t,Lo,m),_(t,ms,m),e(ms,wn),_(t,Oo,m),_(t,K,m),e(K,ye),e(ye,Gs),T(dt,Gs,null),e(K,Tn),e(K,Xs),e(Xs,$n),_(t,Do,m),_(t,Z,m),T(ct,Z,null),e(Z,Mn),e(Z,ee),e(ee,Nn),e(ee,us),e(us,Rn),e(ee,Fn),e(ee,pt),e(pt,jn),e(ee,Jn),e(Z,In),e(Z,te),e(te,Cn),e(te,gs),e(gs,En),e(te,xn),e(te,_s),e(_s,Zn),e(te,Un),e(Z,Wn),T(ve,Z,null),_(t,Ko,m),_(t,se,m),e(se,be),e(be,Qs),T(ft,Qs,null),e(se,kn),e(se,Ss),e(Ss,An),_(t,ea,m),_(t,Q,m),T(ht,Q,null),e(Q,Bn),e(Q,mt),e(mt,Pn),e(mt,ut),e(ut,zn),e(mt,Vn),e(Q,Gn),e(Q,B),T(gt,B,null),e(B,Xn),e(B,oe),e(oe,Qn),e(oe,ys),e(ys,Sn),e(oe,Yn),e(oe,Ys),e(Ys,qn),e(oe,Hn),e(B,Ln),T(we,B,null),e(B,On),T(Te,B,null),_(t,ta,m),_(t,ae,m),e(ae,$e),e($e,qs),T(_t,qs,null),e(ae,Dn),e(ae,Hs),e(Hs,Kn),_(t,sa,m),_(t,U,m),T(yt,U,null),e(U,er),e(U,Ls),e(Ls,tr),e(U,sr),e(U,vt),e(vt,or),e(vt,bt),e(bt,ar),e(vt,nr),e(U,rr),e(U,P),T(wt,P,null),e(P,lr),e(P,ne),e(ne,ir),e(ne,vs),e(vs,dr),e(ne,cr),e(ne,Os),e(Os,pr),e(ne,fr),e(P,hr),T(Me,P,null),e(P,mr),T(Ne,P,null),_(t,oa,m),_(t,re,m),e(re,Re),e(Re,Ds),T(Tt,Ds,null),e(re,ur),e(re,Ks),e(Ks,gr),_(t,aa,m),_(t,S,m),T($t,S,null),e(S,_r),e(S,Mt),e(Mt,yr),e(Mt,Nt),e(Nt,vr),e(Mt,br),e(S,wr),e(S,z),T(Rt,z,null),e(z,Tr),e(z,le),e(le,$r),e(le,bs),e(bs,Mr),e(le,Nr),e(le,eo),e(eo,Rr),e(le,Fr),e(z,jr),T(Fe,z,null),e(z,Jr),T(je,z,null),_(t,na,m),_(t,ie,m),e(ie,Je),e(Je,to),T(Ft,to,null),e(ie,Ir),e(ie,so),e(so,Cr),_(t,ra,m),_(t,W,m),T(jt,W,null),e(W,Er),e(W,oo),e(oo,xr),e(W,Zr),e(W,Jt),e(Jt,Ur),e(Jt,It),e(It,Wr),e(Jt,kr),e(W,Ar),e(W,V),T(Ct,V,null),e(V,Br),e(V,de),e(de,Pr),e(de,ws),e(ws,zr),e(de,Vr),e(de,ao),e(ao,Gr),e(de,Xr),e(V,Qr),T(Ie,V,null),e(V,Sr),T(Ce,V,null),_(t,la,m),_(t,ce,m),e(ce,Ee),e(Ee,no),T(Et,no,null),e(ce,Yr),e(ce,ro),e(ro,qr),_(t,ia,m),_(t,j,m),T(xt,j,null),e(j,Hr),e(j,lo),e(lo,Lr),e(j,Or),e(j,Zt),e(Zt,Dr),e(Zt,Ts),e(Ts,Kr),e(Zt,el),e(j,tl),e(j,Ut),e(Ut,sl),e(Ut,Wt),e(Wt,ol),e(Ut,al),e(j,nl),e(j,io),e(io,rl),e(j,ll),e(j,Y),e(Y,co),e(co,kt),e(kt,il),e(Y,dl),e(Y,po),e(po,At),e(At,cl),e(Y,pl),e(Y,fo),e(fo,Bt),e(Bt,fl),e(Y,hl),e(Y,ho),e(ho,Pt),e(Pt,ml),e(j,ul),e(j,G),T(zt,G,null),e(G,gl),e(G,pe),e(pe,_l),e(pe,mo),e(mo,yl),e(pe,vl),e(pe,uo),e(uo,bl),e(pe,wl),e(G,Tl),T(xe,G,null),e(G,$l),T(Ze,G,null),_(t,da,m),_(t,fe,m),e(fe,Ue),e(Ue,go),T(Vt,go,null),e(fe,Ml),e(fe,_o),e(_o,Nl),_(t,ca,m),_(t,J,m),T(Gt,J,null),e(J,Rl),e(J,yo),e(yo,Fl),e(J,jl),e(J,Xt),e(Xt,Jl),e(Xt,$s),e($s,Il),e(Xt,Cl),e(J,El),e(J,Qt),e(Qt,xl),e(Qt,St),e(St,Zl),e(Qt,Ul),e(J,Wl),e(J,vo),e(vo,kl),e(J,Al),e(J,q),e(q,bo),e(bo,Yt),e(Yt,Bl),e(q,Pl),e(q,wo),e(wo,qt),e(qt,zl),e(q,Vl),e(q,To),e(To,Ht),e(Ht,Gl),e(q,Xl),e(q,$o),e($o,Lt),e(Lt,Ql),e(J,Sl),e(J,X),T(Ot,X,null),e(X,Yl),e(X,he),e(he,ql),e(he,Mo),e(Mo,Hl),e(he,Ll),e(he,No),e(No,Ol),e(he,Dl),e(X,Kl),T(We,X,null),e(X,ei),T(ke,X,null),pa=!0},p(t,[m]){const Dt={};m&2&&(Dt.$$scope={dirty:m,ctx:t}),ve.$set(Dt);const Ro={};m&2&&(Ro.$$scope={dirty:m,ctx:t}),we.$set(Ro);const Fo={};m&2&&(Fo.$$scope={dirty:m,ctx:t}),Te.$set(Fo);const jo={};m&2&&(jo.$$scope={dirty:m,ctx:t}),Me.$set(jo);const Kt={};m&2&&(Kt.$$scope={dirty:m,ctx:t}),Ne.$set(Kt);const Jo={};m&2&&(Jo.$$scope={dirty:m,ctx:t}),Fe.$set(Jo);const Io={};m&2&&(Io.$$scope={dirty:m,ctx:t}),je.$set(Io);const Co={};m&2&&(Co.$$scope={dirty:m,ctx:t}),Ie.$set(Co);const C={};m&2&&(C.$$scope={dirty:m,ctx:t}),Ce.$set(C);const Eo={};m&2&&(Eo.$$scope={dirty:m,ctx:t}),xe.$set(Eo);const xo={};m&2&&(xo.$$scope={dirty:m,ctx:t}),Ze.$set(xo);const Zo={};m&2&&(Zo.$$scope={dirty:m,ctx:t}),We.$set(Zo);const Uo={};m&2&&(Uo.$$scope={dirty:m,ctx:t}),ke.$set(Uo)},i(t){pa||($(r.$$.fragment,t),$(Le.$$.fragment,t),$(nt.$$.fragment,t),$(rt.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(ve.$$.fragment,t),$(ft.$$.fragment,t),$(ht.$$.fragment,t),$(gt.$$.fragment,t),$(we.$$.fragment,t),$(Te.$$.fragment,t),$(_t.$$.fragment,t),$(yt.$$.fragment,t),$(wt.$$.fragment,t),$(Me.$$.fragment,t),$(Ne.$$.fragment,t),$(Tt.$$.fragment,t),$($t.$$.fragment,t),$(Rt.$$.fragment,t),$(Fe.$$.fragment,t),$(je.$$.fragment,t),$(Ft.$$.fragment,t),$(jt.$$.fragment,t),$(Ct.$$.fragment,t),$(Ie.$$.fragment,t),$(Ce.$$.fragment,t),$(Et.$$.fragment,t),$(xt.$$.fragment,t),$(zt.$$.fragment,t),$(xe.$$.fragment,t),$(Ze.$$.fragment,t),$(Vt.$$.fragment,t),$(Gt.$$.fragment,t),$(Ot.$$.fragment,t),$(We.$$.fragment,t),$(ke.$$.fragment,t),pa=!0)},o(t){M(r.$$.fragment,t),M(Le.$$.fragment,t),M(nt.$$.fragment,t),M(rt.$$.fragment,t),M(dt.$$.fragment,t),M(ct.$$.fragment,t),M(ve.$$.fragment,t),M(ft.$$.fragment,t),M(ht.$$.fragment,t),M(gt.$$.fragment,t),M(we.$$.fragment,t),M(Te.$$.fragment,t),M(_t.$$.fragment,t),M(yt.$$.fragment,t),M(wt.$$.fragment,t),M(Me.$$.fragment,t),M(Ne.$$.fragment,t),M(Tt.$$.fragment,t),M($t.$$.fragment,t),M(Rt.$$.fragment,t),M(Fe.$$.fragment,t),M(je.$$.fragment,t),M(Ft.$$.fragment,t),M(jt.$$.fragment,t),M(Ct.$$.fragment,t),M(Ie.$$.fragment,t),M(Ce.$$.fragment,t),M(Et.$$.fragment,t),M(xt.$$.fragment,t),M(zt.$$.fragment,t),M(xe.$$.fragment,t),M(Ze.$$.fragment,t),M(Vt.$$.fragment,t),M(Gt.$$.fragment,t),M(Ot.$$.fragment,t),M(We.$$.fragment,t),M(ke.$$.fragment,t),pa=!1},d(t){s(c),t&&s(v),t&&s(g),N(r),t&&s(Wo),t&&s(O),N(Le),t&&s(ko),t&&s(I),t&&s(Ao),t&&s(as),t&&s(Bo),t&&s(ns),t&&s(Po),t&&s(rs),t&&s(zo),t&&s(ls),t&&s(Vo),t&&s(is),t&&s(Go),t&&s(ue),t&&s(Xo),t&&s(tt),t&&s(Qo),t&&s(A),t&&s(So),t&&s(D),N(nt),t&&s(Yo),t&&s(cs),t&&s(qo),N(rt,t),t&&s(Ho),t&&s(_e),t&&s(Lo),t&&s(ms),t&&s(Oo),t&&s(K),N(dt),t&&s(Do),t&&s(Z),N(ct),N(ve),t&&s(Ko),t&&s(se),N(ft),t&&s(ea),t&&s(Q),N(ht),N(gt),N(we),N(Te),t&&s(ta),t&&s(ae),N(_t),t&&s(sa),t&&s(U),N(yt),N(wt),N(Me),N(Ne),t&&s(oa),t&&s(re),N(Tt),t&&s(aa),t&&s(S),N($t),N(Rt),N(Fe),N(je),t&&s(na),t&&s(ie),N(Ft),t&&s(ra),t&&s(W),N(jt),N(Ct),N(Ie),N(Ce),t&&s(la),t&&s(ce),N(Et),t&&s(ia),t&&s(j),N(xt),N(zt),N(xe),N(Ze),t&&s(da),t&&s(fe),N(Vt),t&&s(ca),t&&s(J),N(Gt),N(Ot),N(We),N(ke)}}}const ac={local:"resnet",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.ResNetConfig",title:"ResNetConfig"},{local:"transformers.ResNetModel",title:"ResNetModel"},{local:"transformers.ResNetForImageClassification",title:"ResNetForImageClassification"},{local:"transformers.TFResNetModel",title:"TFResNetModel"},{local:"transformers.TFResNetForImageClassification",title:"TFResNetForImageClassification"},{local:"transformers.FlaxResNetModel",title:"FlaxResNetModel"},{local:"transformers.FlaxResNetForImageClassification",title:"FlaxResNetForImageClassification"}],title:"ResNet"};function nc(R){return Vd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hc extends kd{constructor(c){super();Ad(this,c,nc,oc,Bd,{})}}export{hc as default,ac as metadata};
