import{S as kd,i as Ad,s as Pd,e as o,k as p,w as b,t as l,M as Bd,c as a,d as s,m as f,a as r,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,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function Qd(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function Sd(R){let c,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function Yd(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function qd(R){let c,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function Hd(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function Ld(R){let c,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function Od(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function Dd(R){let c,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function Kd(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function ec(R){let c,y,g,u,v;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"),y=l("Examples:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Examples:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function tc(R){let c,y,g,u,v;return{c(){c=o("p"),y=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),g=o("code"),u=l("Module"),v=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(n){c=a(n,"P",{});var h=r(c);y=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=r(g);u=i(F,"Module"),F.forEach(s),v=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(n,h){_(n,c,h),e(c,y),e(c,g),e(g,u),e(c,v)},d(n){n&&s(c)}}}function sc(R){let c,y,g,u,v;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"),y=l("Example:"),g=p(),b(u.$$.fragment)},l(n){c=a(n,"P",{});var h=r(c);y=i(h,"Example:"),h.forEach(s),g=f(n),w(u.$$.fragment,n)},m(n,h){_(n,c,h),e(c,y),_(n,g,h),T(u,n,h),v=!0},p:ss,i(n){v||($(u.$$.fragment,n),v=!0)},o(n){M(u.$$.fragment,n),v=!1},d(n){n&&s(c),n&&s(g),N(u,n)}}}function oc(R){let c,y,g,u,v,n,h,F,Ca,Wo,O,me,Us,Le,Ea,Ws,xa,ko,I,Za,Oe,Ua,Wa,De,ka,Aa,ks,Pa,Ba,As,za,Va,Ps,Ga,Xa,Ao,as,Qa,Po,rs,Sa,Bo,ns,Bs,Ya,zo,ls,qa,Vo,is,Ke,Ha,ds,La,Oa,Go,ue,Da,et,Ka,er,Xo,tt,si,Qo,A,tr,st,sr,or,ot,ar,rr,at,nr,lr,So,D,ge,zs,rt,ir,Vs,dr,Yo,cs,cr,qo,nt,Ho,_e,H,ps,pr,fr,lt,hr,mr,it,ur,gr,_r,fs,vr,hs,yr,Lo,ms,br,Oo,K,ve,Gs,dt,wr,Xs,Tr,Do,Z,ct,$r,ee,Mr,us,Nr,Rr,pt,Fr,jr,Jr,te,Ir,gs,Cr,Er,_s,xr,Zr,Ur,ye,Ko,se,be,Qs,ft,Wr,Ss,kr,ea,Q,ht,Ar,mt,Pr,ut,Br,zr,Vr,P,gt,Gr,oe,Xr,vs,Qr,Sr,Ys,Yr,qr,Hr,we,Lr,Te,ta,ae,$e,qs,_t,Or,Hs,Dr,sa,U,vt,Kr,Ls,en,tn,yt,sn,bt,on,an,rn,B,wt,nn,re,ln,ys,dn,cn,Os,pn,fn,hn,Me,mn,Ne,oa,ne,Re,Ds,Tt,un,Ks,gn,aa,S,$t,_n,Mt,vn,Nt,yn,bn,wn,z,Rt,Tn,le,$n,bs,Mn,Nn,eo,Rn,Fn,jn,Fe,Jn,je,ra,ie,Je,to,Ft,In,so,Cn,na,W,jt,En,oo,xn,Zn,Jt,Un,It,Wn,kn,An,V,Ct,Pn,de,Bn,ws,zn,Vn,ao,Gn,Xn,Qn,Ie,Sn,Ce,la,ce,Ee,ro,Et,Yn,no,qn,ia,j,xt,Hn,lo,Ln,On,Zt,Dn,Ts,Kn,el,tl,Ut,sl,Wt,ol,al,rl,io,nl,ll,Y,co,kt,il,dl,po,At,cl,pl,fo,Pt,fl,hl,ho,Bt,ml,ul,G,zt,gl,pe,_l,mo,vl,yl,uo,bl,wl,Tl,xe,$l,Ze,da,fe,Ue,go,Vt,Ml,_o,Nl,ca,J,Gt,Rl,vo,Fl,jl,Xt,Jl,$s,Il,Cl,El,Qt,xl,St,Zl,Ul,Wl,yo,kl,Al,q,bo,Yt,Pl,Bl,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 n=new L({}),Le=new L({}),rt=new L({}),nt=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.31.0/src/transformers/models/resnet/configuration_resnet.py#L35"}}),ye=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.31.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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/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.31.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({}),vt=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.31.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.31.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.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.31.0/src/transformers/models/resnet/modeling_resnet.py#L369",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.ImageClassifierOutputWithNoAttention"
>transformers.modeling_outputs.ImageClassifierOutputWithNoAttention</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/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.31.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.31.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.31.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.31.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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/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.31.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.31.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.31.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.31.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.31.0/en/model_doc/auto#transformers.AutoImageProcessor">AutoImageProcessor</a>. See
<a href="/docs/transformers/v4.31.0/en/model_doc/perceiver#transformers.PerceiverFeatureExtractor.__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.31.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.31.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.31.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.31.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.31.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.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.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.31.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.31.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.31.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.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_fp16">to_fp16()</a> and
<a href="/docs/transformers/v4.31.0/en/main_classes/model#transformers.FlaxPreTrainedModel.to_bf16">to_bf16()</a>.`,name:"dtype"}],source:"https://github.com/huggingface/transformers/blob/v4.31.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.31.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"),y=p(),g=o("h1"),u=o("a"),v=o("span"),b(n.$$.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"),Pa=l("stride=2"),Ba=l(" for downsampling in bottleneck\u2019s "),As=o("code"),za=l("3x3"),Va=l(" conv and not in the first "),Ps=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."),Po=p(),rs=o("p"),Sa=l("The abstract from the paper is the following:"),Bo=p(),ns=o("p"),Bs=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"),er=l("."),Xo=p(),tt=o("img"),Qo=p(),A=o("p"),tr=l("This model was contributed by "),st=o("a"),sr=l("Francesco"),or=l(". The TensorFlow version of this model was added by "),ot=o("a"),ar=l("amyeroberts"),rr=l(". The original code can be found "),at=o("a"),nr=l("here"),lr=l("."),So=p(),D=o("h2"),ge=o("a"),zs=o("span"),b(rt.$$.fragment),ir=p(),Vs=o("span"),dr=l("Resources"),Yo=p(),cs=o("p"),cr=l("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),qo=p(),b(nt.$$.fragment),Ho=p(),_e=o("ul"),H=o("li"),ps=o("a"),pr=l("ResNetForImageClassification"),fr=l(" is supported by this "),lt=o("a"),hr=l("example script"),mr=l(" and "),it=o("a"),ur=l("notebook"),gr=l("."),_r=p(),fs=o("li"),vr=l("See also: "),hs=o("a"),yr=l("Image classification task guide"),Lo=p(),ms=o("p"),br=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"),ve=o("a"),Gs=o("span"),b(dt.$$.fragment),wr=p(),Xs=o("span"),Tr=l("ResNetConfig"),Do=p(),Z=o("div"),b(ct.$$.fragment),$r=p(),ee=o("p"),Mr=l("This is the configuration class to store the configuration of a "),us=o("a"),Nr=l("ResNetModel"),Rr=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"),Fr=l("microsoft/resnet-50"),jr=l(" architecture."),Jr=p(),te=o("p"),Ir=l("Configuration objects inherit from "),gs=o("a"),Cr=l("PretrainedConfig"),Er=l(` and can be used to control the model outputs. Read the
documentation from `),_s=o("a"),xr=l("PretrainedConfig"),Zr=l(" for more information."),Ur=p(),b(ye.$$.fragment),Ko=p(),se=o("h2"),be=o("a"),Qs=o("span"),b(ft.$$.fragment),Wr=p(),Ss=o("span"),kr=l("ResNetModel"),ea=p(),Q=o("div"),b(ht.$$.fragment),Ar=p(),mt=o("p"),Pr=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=o("a"),Br=l("torch.nn.Module"),zr=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Vr=p(),P=o("div"),b(gt.$$.fragment),Gr=p(),oe=o("p"),Xr=l("The "),vs=o("a"),Qr=l("ResNetModel"),Sr=l(" forward method, overrides the "),Ys=o("code"),Yr=l("__call__"),qr=l(" special method."),Hr=p(),b(we.$$.fragment),Lr=p(),b(Te.$$.fragment),ta=p(),ae=o("h2"),$e=o("a"),qs=o("span"),b(_t.$$.fragment),Or=p(),Hs=o("span"),Dr=l("ResNetForImageClassification"),sa=p(),U=o("div"),b(vt.$$.fragment),Kr=p(),Ls=o("p"),en=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),tn=p(),yt=o("p"),sn=l("This model is a PyTorch "),bt=o("a"),on=l("torch.nn.Module"),an=l(` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rn=p(),B=o("div"),b(wt.$$.fragment),nn=p(),re=o("p"),ln=l("The "),ys=o("a"),dn=l("ResNetForImageClassification"),cn=l(" forward method, overrides the "),Os=o("code"),pn=l("__call__"),fn=l(" special method."),hn=p(),b(Me.$$.fragment),mn=p(),b(Ne.$$.fragment),oa=p(),ne=o("h2"),Re=o("a"),Ds=o("span"),b(Tt.$$.fragment),un=p(),Ks=o("span"),gn=l("TFResNetModel"),aa=p(),S=o("div"),b($t.$$.fragment),_n=p(),Mt=o("p"),vn=l(`The bare ResNet model outputting raw features without any specific head on top.
This model is a TensorFlow
`),Nt=o("a"),yn=l("tf.keras.layers.Layer"),bn=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.`),wn=p(),z=o("div"),b(Rt.$$.fragment),Tn=p(),le=o("p"),$n=l("The "),bs=o("a"),Mn=l("TFResNetModel"),Nn=l(" forward method, overrides the "),eo=o("code"),Rn=l("__call__"),Fn=l(" special method."),jn=p(),b(Fe.$$.fragment),Jn=p(),b(je.$$.fragment),ra=p(),ie=o("h2"),Je=o("a"),to=o("span"),b(Ft.$$.fragment),In=p(),so=o("span"),Cn=l("TFResNetForImageClassification"),na=p(),W=o("div"),b(jt.$$.fragment),En=p(),oo=o("p"),xn=l(`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Zn=p(),Jt=o("p"),Un=l(`This model is a TensorFlow
`),It=o("a"),Wn=l("tf.keras.layers.Layer"),kn=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.`),An=p(),V=o("div"),b(Ct.$$.fragment),Pn=p(),de=o("p"),Bn=l("The "),ws=o("a"),zn=l("TFResNetForImageClassification"),Vn=l(" forward method, overrides the "),ao=o("code"),Gn=l("__call__"),Xn=l(" special method."),Qn=p(),b(Ie.$$.fragment),Sn=p(),b(Ce.$$.fragment),la=p(),ce=o("h2"),Ee=o("a"),ro=o("span"),b(Et.$$.fragment),Yn=p(),no=o("span"),qn=l("FlaxResNetModel"),ia=p(),j=o("div"),b(xt.$$.fragment),Hn=p(),lo=o("p"),Ln=l("The bare ResNet model outputting raw features without any specific head on top."),On=p(),Zt=o("p"),Dn=l("This model inherits from "),Ts=o("a"),Kn=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.`),rl=p(),io=o("p"),nl=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"),Pt=o("a"),fl=l("Vectorization"),hl=p(),ho=o("li"),Bt=o("a"),ml=l("Parallelization"),ul=p(),G=o("div"),b(zt.$$.fragment),gl=p(),pe=o("p"),_l=l("The "),mo=o("code"),vl=l("FlaxResNetPreTrainedModel"),yl=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(),vo=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(),yo=o("p"),kl=l("Finally, this model supports inherent JAX features such as:"),Al=p(),q=o("ul"),bo=o("li"),Yt=o("a"),Pl=l("Just-In-Time (JIT) compilation"),Bl=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=Bd('[data-svelte="svelte-1phssyn"]',document.head);c=a(m,"META",{name:!0,content:!0}),m.forEach(s),y=f(t),g=a(t,"H1",{class:!0});var Dt=r(g);u=a(Dt,"A",{id:!0,class:!0,href:!0});var Ro=r(u);v=a(Ro,"SPAN",{});var Fo=r(v);w(n.$$.fragment,Fo),Fo.forEach(s),Ro.forEach(s),h=f(Dt),F=a(Dt,"SPAN",{});var jo=r(F);Ca=i(jo,"ResNet"),jo.forEach(s),Dt.forEach(s),Wo=f(t),O=a(t,"H2",{class:!0});var Kt=r(O);me=a(Kt,"A",{id:!0,class:!0,href:!0});var Jo=r(me);Us=a(Jo,"SPAN",{});var Io=r(Us);w(Le.$$.fragment,Io),Io.forEach(s),Jo.forEach(s),Ea=f(Kt),Ws=a(Kt,"SPAN",{});var Co=r(Ws);xa=i(Co,"Overview"),Co.forEach(s),Kt.forEach(s),ko=f(t),I=a(t,"P",{});var C=r(I);Za=i(C,"The ResNet model was proposed in "),Oe=a(C,"A",{href:!0,rel:!0});var Eo=r(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=r(De);ka=i(xo,"Nvidia"),xo.forEach(s),Aa=i(C,", we apply the "),ks=a(C,"CODE",{});var Zo=r(ks);Pa=i(Zo,"stride=2"),Zo.forEach(s),Ba=i(C," for downsampling in bottleneck\u2019s "),As=a(C,"CODE",{});var Uo=r(As);za=i(Uo,"3x3"),Uo.forEach(s),Va=i(C," conv and not in the first "),Ps=a(C,"CODE",{});var oi=r(Ps);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=r(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),Po=f(t),rs=a(t,"P",{});var ri=r(rs);Sa=i(ri,"The abstract from the paper is the following:"),ri.forEach(s),Bo=f(t),ns=a(t,"P",{});var ni=r(ns);Bs=a(ni,"EM",{});var li=r(Bs);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),ni.forEach(s),zo=f(t),ls=a(t,"P",{});var ii=r(ls);qa=i(ii,"Tips:"),ii.forEach(s),Vo=f(t),is=a(t,"UL",{});var di=r(is);Ke=a(di,"LI",{});var fa=r(Ke);Ha=i(fa,"One can use "),ds=a(fa,"A",{href:!0});var ci=r(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=r(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=r(et);Ka=i(pi,"original paper"),pi.forEach(s),er=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=r(A);tr=i(Ae,"This model was contributed by "),st=a(Ae,"A",{href:!0,rel:!0});var fi=r(st);sr=i(fi,"Francesco"),fi.forEach(s),or=i(Ae,". The TensorFlow version of this model was added by "),ot=a(Ae,"A",{href:!0,rel:!0});var hi=r(ot);ar=i(hi,"amyeroberts"),hi.forEach(s),rr=i(Ae,". The original code can be found "),at=a(Ae,"A",{href:!0,rel:!0});var mi=r(at);nr=i(mi,"here"),mi.forEach(s),lr=i(Ae,"."),Ae.forEach(s),So=f(t),D=a(t,"H2",{class:!0});var ma=r(D);ge=a(ma,"A",{id:!0,class:!0,href:!0});var ui=r(ge);zs=a(ui,"SPAN",{});var gi=r(zs);w(rt.$$.fragment,gi),gi.forEach(s),ui.forEach(s),ir=f(ma),Vs=a(ma,"SPAN",{});var _i=r(Vs);dr=i(_i,"Resources"),_i.forEach(s),ma.forEach(s),Yo=f(t),cs=a(t,"P",{});var vi=r(cs);cr=i(vi,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with ResNet."),vi.forEach(s),qo=f(t),w(nt.$$.fragment,t),Ho=f(t),_e=a(t,"UL",{});var ua=r(_e);H=a(ua,"LI",{});var es=r(H);ps=a(es,"A",{href:!0});var yi=r(ps);pr=i(yi,"ResNetForImageClassification"),yi.forEach(s),fr=i(es," is supported by this "),lt=a(es,"A",{href:!0,rel:!0});var bi=r(lt);hr=i(bi,"example script"),bi.forEach(s),mr=i(es," and "),it=a(es,"A",{href:!0,rel:!0});var wi=r(it);ur=i(wi,"notebook"),wi.forEach(s),gr=i(es,"."),es.forEach(s),_r=f(ua),fs=a(ua,"LI",{});var ti=r(fs);vr=i(ti,"See also: "),hs=a(ti,"A",{href:!0});var Ti=r(hs);yr=i(Ti,"Image classification task guide"),Ti.forEach(s),ti.forEach(s),ua.forEach(s),Lo=f(t),ms=a(t,"P",{});var $i=r(ms);br=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=r(K);ve=a(ga,"A",{id:!0,class:!0,href:!0});var Mi=r(ve);Gs=a(Mi,"SPAN",{});var Ni=r(Gs);w(dt.$$.fragment,Ni),Ni.forEach(s),Mi.forEach(s),wr=f(ga),Xs=a(ga,"SPAN",{});var Ri=r(Xs);Tr=i(Ri,"ResNetConfig"),Ri.forEach(s),ga.forEach(s),Do=f(t),Z=a(t,"DIV",{class:!0});var Pe=r(Z);w(ct.$$.fragment,Pe),$r=f(Pe),ee=a(Pe,"P",{});var Ms=r(ee);Mr=i(Ms,"This is the configuration class to store the configuration of a "),us=a(Ms,"A",{href:!0});var Fi=r(us);Nr=i(Fi,"ResNetModel"),Fi.forEach(s),Rr=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=r(pt);Fr=i(ji,"microsoft/resnet-50"),ji.forEach(s),jr=i(Ms," architecture."),Ms.forEach(s),Jr=f(Pe),te=a(Pe,"P",{});var Ns=r(te);Ir=i(Ns,"Configuration objects inherit from "),gs=a(Ns,"A",{href:!0});var Ji=r(gs);Cr=i(Ji,"PretrainedConfig"),Ji.forEach(s),Er=i(Ns,` and can be used to control the model outputs. Read the
documentation from `),_s=a(Ns,"A",{href:!0});var Ii=r(_s);xr=i(Ii,"PretrainedConfig"),Ii.forEach(s),Zr=i(Ns," for more information."),Ns.forEach(s),Ur=f(Pe),w(ye.$$.fragment,Pe),Pe.forEach(s),Ko=f(t),se=a(t,"H2",{class:!0});var _a=r(se);be=a(_a,"A",{id:!0,class:!0,href:!0});var Ci=r(be);Qs=a(Ci,"SPAN",{});var Ei=r(Qs);w(ft.$$.fragment,Ei),Ei.forEach(s),Ci.forEach(s),Wr=f(_a),Ss=a(_a,"SPAN",{});var xi=r(Ss);kr=i(xi,"ResNetModel"),xi.forEach(s),_a.forEach(s),ea=f(t),Q=a(t,"DIV",{class:!0});var Rs=r(Q);w(ht.$$.fragment,Rs),Ar=f(Rs),mt=a(Rs,"P",{});var va=r(mt);Pr=i(va,`The bare ResNet model outputting raw features without any specific head on top.
This model is a PyTorch `),ut=a(va,"A",{href:!0,rel:!0});var Zi=r(ut);Br=i(Zi,"torch.nn.Module"),Zi.forEach(s),zr=i(va,` subclass. Use it
as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),va.forEach(s),Vr=f(Rs),P=a(Rs,"DIV",{class:!0});var Be=r(P);w(gt.$$.fragment,Be),Gr=f(Be),oe=a(Be,"P",{});var Fs=r(oe);Xr=i(Fs,"The "),vs=a(Fs,"A",{href:!0});var Ui=r(vs);Qr=i(Ui,"ResNetModel"),Ui.forEach(s),Sr=i(Fs," forward method, overrides the "),Ys=a(Fs,"CODE",{});var Wi=r(Ys);Yr=i(Wi,"__call__"),Wi.forEach(s),qr=i(Fs," special method."),Fs.forEach(s),Hr=f(Be),w(we.$$.fragment,Be),Lr=f(Be),w(Te.$$.fragment,Be),Be.forEach(s),Rs.forEach(s),ta=f(t),ae=a(t,"H2",{class:!0});var ya=r(ae);$e=a(ya,"A",{id:!0,class:!0,href:!0});var ki=r($e);qs=a(ki,"SPAN",{});var Ai=r(qs);w(_t.$$.fragment,Ai),Ai.forEach(s),ki.forEach(s),Or=f(ya),Hs=a(ya,"SPAN",{});var Pi=r(Hs);Dr=i(Pi,"ResNetForImageClassification"),Pi.forEach(s),ya.forEach(s),sa=f(t),U=a(t,"DIV",{class:!0});var ze=r(U);w(vt.$$.fragment,ze),Kr=f(ze),Ls=a(ze,"P",{});var Bi=r(Ls);en=i(Bi,`ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for
ImageNet.`),Bi.forEach(s),tn=f(ze),yt=a(ze,"P",{});var ba=r(yt);sn=i(ba,"This model is a PyTorch "),bt=a(ba,"A",{href:!0,rel:!0});var zi=r(bt);on=i(zi,"torch.nn.Module"),zi.forEach(s),an=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),rn=f(ze),B=a(ze,"DIV",{class:!0});var Ve=r(B);w(wt.$$.fragment,Ve),nn=f(Ve),re=a(Ve,"P",{});var js=r(re);ln=i(js,"The "),ys=a(js,"A",{href:!0});var Vi=r(ys);dn=i(Vi,"ResNetForImageClassification"),Vi.forEach(s),cn=i(js," forward method, overrides the "),Os=a(js,"CODE",{});var Gi=r(Os);pn=i(Gi,"__call__"),Gi.forEach(s),fn=i(js," special method."),js.forEach(s),hn=f(Ve),w(Me.$$.fragment,Ve),mn=f(Ve),w(Ne.$$.fragment,Ve),Ve.forEach(s),ze.forEach(s),oa=f(t),ne=a(t,"H2",{class:!0});var wa=r(ne);Re=a(wa,"A",{id:!0,class:!0,href:!0});var Xi=r(Re);Ds=a(Xi,"SPAN",{});var Qi=r(Ds);w(Tt.$$.fragment,Qi),Qi.forEach(s),Xi.forEach(s),un=f(wa),Ks=a(wa,"SPAN",{});var Si=r(Ks);gn=i(Si,"TFResNetModel"),Si.forEach(s),wa.forEach(s),aa=f(t),S=a(t,"DIV",{class:!0});var Js=r(S);w($t.$$.fragment,Js),_n=f(Js),Mt=a(Js,"P",{});var Ta=r(Mt);vn=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=r(Nt);yn=i(Yi,"tf.keras.layers.Layer"),Yi.forEach(s),bn=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),wn=f(Js),z=a(Js,"DIV",{class:!0});var Ge=r(z);w(Rt.$$.fragment,Ge),Tn=f(Ge),le=a(Ge,"P",{});var Is=r(le);$n=i(Is,"The "),bs=a(Is,"A",{href:!0});var qi=r(bs);Mn=i(qi,"TFResNetModel"),qi.forEach(s),Nn=i(Is," forward method, overrides the "),eo=a(Is,"CODE",{});var Hi=r(eo);Rn=i(Hi,"__call__"),Hi.forEach(s),Fn=i(Is," special method."),Is.forEach(s),jn=f(Ge),w(Fe.$$.fragment,Ge),Jn=f(Ge),w(je.$$.fragment,Ge),Ge.forEach(s),Js.forEach(s),ra=f(t),ie=a(t,"H2",{class:!0});var $a=r(ie);Je=a($a,"A",{id:!0,class:!0,href:!0});var Li=r(Je);to=a(Li,"SPAN",{});var Oi=r(to);w(Ft.$$.fragment,Oi),Oi.forEach(s),Li.forEach(s),In=f($a),so=a($a,"SPAN",{});var Di=r(so);Cn=i(Di,"TFResNetForImageClassification"),Di.forEach(s),$a.forEach(s),na=f(t),W=a(t,"DIV",{class:!0});var Xe=r(W);w(jt.$$.fragment,Xe),En=f(Xe),oo=a(Xe,"P",{});var Ki=r(oo);xn=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),Zn=f(Xe),Jt=a(Xe,"P",{});var Ma=r(Jt);Un=i(Ma,`This model is a TensorFlow
`),It=a(Ma,"A",{href:!0,rel:!0});var ed=r(It);Wn=i(ed,"tf.keras.layers.Layer"),ed.forEach(s),kn=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),An=f(Xe),V=a(Xe,"DIV",{class:!0});var Qe=r(V);w(Ct.$$.fragment,Qe),Pn=f(Qe),de=a(Qe,"P",{});var Cs=r(de);Bn=i(Cs,"The "),ws=a(Cs,"A",{href:!0});var td=r(ws);zn=i(td,"TFResNetForImageClassification"),td.forEach(s),Vn=i(Cs," forward method, overrides the "),ao=a(Cs,"CODE",{});var sd=r(ao);Gn=i(sd,"__call__"),sd.forEach(s),Xn=i(Cs," special method."),Cs.forEach(s),Qn=f(Qe),w(Ie.$$.fragment,Qe),Sn=f(Qe),w(Ce.$$.fragment,Qe),Qe.forEach(s),Xe.forEach(s),la=f(t),ce=a(t,"H2",{class:!0});var Na=r(ce);Ee=a(Na,"A",{id:!0,class:!0,href:!0});var od=r(Ee);ro=a(od,"SPAN",{});var ad=r(ro);w(Et.$$.fragment,ad),ad.forEach(s),od.forEach(s),Yn=f(Na),no=a(Na,"SPAN",{});var rd=r(no);qn=i(rd,"FlaxResNetModel"),rd.forEach(s),Na.forEach(s),ia=f(t),j=a(t,"DIV",{class:!0});var E=r(j);w(xt.$$.fragment,E),Hn=f(E),lo=a(E,"P",{});var nd=r(lo);Ln=i(nd,"The bare ResNet model outputting raw features without any specific head on top."),nd.forEach(s),On=f(E),Zt=a(E,"P",{});var Ra=r(Zt);Dn=i(Ra,"This model inherits from "),Ts=a(Ra,"A",{href:!0});var ld=r(Ts);Kn=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=r(Ut);sl=i(Fa,"This model is also a Flax Linen "),Wt=a(Fa,"A",{href:!0,rel:!0});var id=r(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),rl=f(E),io=a(E,"P",{});var dd=r(io);nl=i(dd,"Finally, this model supports inherent JAX features such as:"),dd.forEach(s),ll=f(E),Y=a(E,"UL",{});var Se=r(Y);co=a(Se,"LI",{});var cd=r(co);kt=a(cd,"A",{href:!0,rel:!0});var pd=r(kt);il=i(pd,"Just-In-Time (JIT) compilation"),pd.forEach(s),cd.forEach(s),dl=f(Se),po=a(Se,"LI",{});var fd=r(po);At=a(fd,"A",{href:!0,rel:!0});var hd=r(At);cl=i(hd,"Automatic Differentiation"),hd.forEach(s),fd.forEach(s),pl=f(Se),fo=a(Se,"LI",{});var md=r(fo);Pt=a(md,"A",{href:!0,rel:!0});var ud=r(Pt);fl=i(ud,"Vectorization"),ud.forEach(s),md.forEach(s),hl=f(Se),ho=a(Se,"LI",{});var gd=r(ho);Bt=a(gd,"A",{href:!0,rel:!0});var _d=r(Bt);ml=i(_d,"Parallelization"),_d.forEach(s),gd.forEach(s),Se.forEach(s),ul=f(E),G=a(E,"DIV",{class:!0});var Ye=r(G);w(zt.$$.fragment,Ye),gl=f(Ye),pe=a(Ye,"P",{});var Es=r(pe);_l=i(Es,"The "),mo=a(Es,"CODE",{});var vd=r(mo);vl=i(vd,"FlaxResNetPreTrainedModel"),vd.forEach(s),yl=i(Es," forward method, overrides the "),uo=a(Es,"CODE",{});var yd=r(uo);bl=i(yd,"__call__"),yd.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=r(fe);Ue=a(ja,"A",{id:!0,class:!0,href:!0});var bd=r(Ue);go=a(bd,"SPAN",{});var wd=r(go);w(Vt.$$.fragment,wd),wd.forEach(s),bd.forEach(s),Ml=f(ja),_o=a(ja,"SPAN",{});var Td=r(_o);Nl=i(Td,"FlaxResNetForImageClassification"),Td.forEach(s),ja.forEach(s),ca=f(t),J=a(t,"DIV",{class:!0});var x=r(J);w(Gt.$$.fragment,x),Rl=f(x),vo=a(x,"P",{});var $d=r(vo);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=r(Xt);Jl=i(Ja,"This model inherits from "),$s=a(Ja,"A",{href:!0});var Md=r($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=r(Qt);xl=i(Ia,"This model is also a Flax Linen "),St=a(Ia,"A",{href:!0,rel:!0});var Nd=r(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),yo=a(x,"P",{});var Rd=r(yo);kl=i(Rd,"Finally, this model supports inherent JAX features such as:"),Rd.forEach(s),Al=f(x),q=a(x,"UL",{});var qe=r(q);bo=a(qe,"LI",{});var Fd=r(bo);Yt=a(Fd,"A",{href:!0,rel:!0});var jd=r(Yt);Pl=i(jd,"Just-In-Time (JIT) compilation"),jd.forEach(s),Fd.forEach(s),Bl=f(qe),wo=a(qe,"LI",{});var Jd=r(wo);qt=a(Jd,"A",{href:!0,rel:!0});var Id=r(qt);zl=i(Id,"Automatic Differentiation"),Id.forEach(s),Jd.forEach(s),Vl=f(qe),To=a(qe,"LI",{});var Cd=r(To);Ht=a(Cd,"A",{href:!0,rel:!0});var Ed=r(Ht);Gl=i(Ed,"Vectorization"),Ed.forEach(s),Cd.forEach(s),Xl=f(qe),$o=a(qe,"LI",{});var xd=r($o);Lt=a(xd,"A",{href:!0,rel:!0});var Zd=r(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=r(X);w(Ot.$$.fragment,He),Yl=f(He),he=a(He,"P",{});var xs=r(he);ql=i(xs,"The "),Mo=a(xs,"CODE",{});var Ud=r(Mo);Hl=i(Ud,"FlaxResNetPreTrainedModel"),Ud.forEach(s),Ll=i(xs," forward method, overrides the "),No=a(xs,"CODE",{});var Wd=r(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.31.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.31.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(ve,"id","transformers.ResNetConfig"),d(ve,"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(ve,"href","#transformers.ResNetConfig"),d(K,"class","relative group"),d(us,"href","/docs/transformers/v4.31.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.31.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(_s,"href","/docs/transformers/v4.31.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(vs,"href","/docs/transformers/v4.31.0/en/model_doc/resnet#transformers.ResNetModel"),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(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(ys,"href","/docs/transformers/v4.31.0/en/model_doc/resnet#transformers.ResNetForImageClassification"),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(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(ne,"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.31.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.31.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.31.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(Pt,"href","https://jax.readthedocs.io/en/latest/jax.html#vectorization-vmap"),d(Pt,"rel","nofollow"),d(Bt,"href","https://jax.readthedocs.io/en/latest/jax.html#parallelization-pmap"),d(Bt,"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.31.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,y,m),_(t,g,m),e(g,u),e(u,v),T(n,v,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,Pa),e(I,Ba),e(I,As),e(As,za),e(I,Va),e(I,Ps),e(Ps,Ga),e(I,Xa),_(t,Ao,m),_(t,as,m),e(as,Qa),_(t,Po,m),_(t,rs,m),e(rs,Sa),_(t,Bo,m),_(t,ns,m),e(ns,Bs),e(Bs,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,er),_(t,Xo,m),_(t,tt,m),_(t,Qo,m),_(t,A,m),e(A,tr),e(A,st),e(st,sr),e(A,or),e(A,ot),e(ot,ar),e(A,rr),e(A,at),e(at,nr),e(A,lr),_(t,So,m),_(t,D,m),e(D,ge),e(ge,zs),T(rt,zs,null),e(D,ir),e(D,Vs),e(Vs,dr),_(t,Yo,m),_(t,cs,m),e(cs,cr),_(t,qo,m),T(nt,t,m),_(t,Ho,m),_(t,_e,m),e(_e,H),e(H,ps),e(ps,pr),e(H,fr),e(H,lt),e(lt,hr),e(H,mr),e(H,it),e(it,ur),e(H,gr),e(_e,_r),e(_e,fs),e(fs,vr),e(fs,hs),e(hs,yr),_(t,Lo,m),_(t,ms,m),e(ms,br),_(t,Oo,m),_(t,K,m),e(K,ve),e(ve,Gs),T(dt,Gs,null),e(K,wr),e(K,Xs),e(Xs,Tr),_(t,Do,m),_(t,Z,m),T(ct,Z,null),e(Z,$r),e(Z,ee),e(ee,Mr),e(ee,us),e(us,Nr),e(ee,Rr),e(ee,pt),e(pt,Fr),e(ee,jr),e(Z,Jr),e(Z,te),e(te,Ir),e(te,gs),e(gs,Cr),e(te,Er),e(te,_s),e(_s,xr),e(te,Zr),e(Z,Ur),T(ye,Z,null),_(t,Ko,m),_(t,se,m),e(se,be),e(be,Qs),T(ft,Qs,null),e(se,Wr),e(se,Ss),e(Ss,kr),_(t,ea,m),_(t,Q,m),T(ht,Q,null),e(Q,Ar),e(Q,mt),e(mt,Pr),e(mt,ut),e(ut,Br),e(mt,zr),e(Q,Vr),e(Q,P),T(gt,P,null),e(P,Gr),e(P,oe),e(oe,Xr),e(oe,vs),e(vs,Qr),e(oe,Sr),e(oe,Ys),e(Ys,Yr),e(oe,qr),e(P,Hr),T(we,P,null),e(P,Lr),T(Te,P,null),_(t,ta,m),_(t,ae,m),e(ae,$e),e($e,qs),T(_t,qs,null),e(ae,Or),e(ae,Hs),e(Hs,Dr),_(t,sa,m),_(t,U,m),T(vt,U,null),e(U,Kr),e(U,Ls),e(Ls,en),e(U,tn),e(U,yt),e(yt,sn),e(yt,bt),e(bt,on),e(yt,an),e(U,rn),e(U,B),T(wt,B,null),e(B,nn),e(B,re),e(re,ln),e(re,ys),e(ys,dn),e(re,cn),e(re,Os),e(Os,pn),e(re,fn),e(B,hn),T(Me,B,null),e(B,mn),T(Ne,B,null),_(t,oa,m),_(t,ne,m),e(ne,Re),e(Re,Ds),T(Tt,Ds,null),e(ne,un),e(ne,Ks),e(Ks,gn),_(t,aa,m),_(t,S,m),T($t,S,null),e(S,_n),e(S,Mt),e(Mt,vn),e(Mt,Nt),e(Nt,yn),e(Mt,bn),e(S,wn),e(S,z),T(Rt,z,null),e(z,Tn),e(z,le),e(le,$n),e(le,bs),e(bs,Mn),e(le,Nn),e(le,eo),e(eo,Rn),e(le,Fn),e(z,jn),T(Fe,z,null),e(z,Jn),T(je,z,null),_(t,ra,m),_(t,ie,m),e(ie,Je),e(Je,to),T(Ft,to,null),e(ie,In),e(ie,so),e(so,Cn),_(t,na,m),_(t,W,m),T(jt,W,null),e(W,En),e(W,oo),e(oo,xn),e(W,Zn),e(W,Jt),e(Jt,Un),e(Jt,It),e(It,Wn),e(Jt,kn),e(W,An),e(W,V),T(Ct,V,null),e(V,Pn),e(V,de),e(de,Bn),e(de,ws),e(ws,zn),e(de,Vn),e(de,ao),e(ao,Gn),e(de,Xn),e(V,Qn),T(Ie,V,null),e(V,Sn),T(Ce,V,null),_(t,la,m),_(t,ce,m),e(ce,Ee),e(Ee,ro),T(Et,ro,null),e(ce,Yn),e(ce,no),e(no,qn),_(t,ia,m),_(t,j,m),T(xt,j,null),e(j,Hn),e(j,lo),e(lo,Ln),e(j,On),e(j,Zt),e(Zt,Dn),e(Zt,Ts),e(Ts,Kn),e(Zt,el),e(j,tl),e(j,Ut),e(Ut,sl),e(Ut,Wt),e(Wt,ol),e(Ut,al),e(j,rl),e(j,io),e(io,nl),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,Pt),e(Pt,fl),e(Y,hl),e(Y,ho),e(ho,Bt),e(Bt,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,vl),e(pe,yl),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,vo),e(vo,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,yo),e(yo,kl),e(J,Al),e(J,q),e(q,bo),e(bo,Yt),e(Yt,Pl),e(q,Bl),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}),ye.$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||($(n.$$.fragment,t),$(Le.$$.fragment,t),$(rt.$$.fragment,t),$(nt.$$.fragment,t),$(dt.$$.fragment,t),$(ct.$$.fragment,t),$(ye.$$.fragment,t),$(ft.$$.fragment,t),$(ht.$$.fragment,t),$(gt.$$.fragment,t),$(we.$$.fragment,t),$(Te.$$.fragment,t),$(_t.$$.fragment,t),$(vt.$$.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(n.$$.fragment,t),M(Le.$$.fragment,t),M(rt.$$.fragment,t),M(nt.$$.fragment,t),M(dt.$$.fragment,t),M(ct.$$.fragment,t),M(ye.$$.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(vt.$$.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(y),t&&s(g),N(n),t&&s(Wo),t&&s(O),N(Le),t&&s(ko),t&&s(I),t&&s(Ao),t&&s(as),t&&s(Po),t&&s(rs),t&&s(Bo),t&&s(ns),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(rt),t&&s(Yo),t&&s(cs),t&&s(qo),N(nt,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(ye),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(vt),N(wt),N(Me),N(Ne),t&&s(oa),t&&s(ne),N(Tt),t&&s(aa),t&&s(S),N($t),N(Rt),N(Fe),N(je),t&&s(ra),t&&s(ie),N(Ft),t&&s(na),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 rc(R){return Vd(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class hc extends kd{constructor(c){super();Ad(this,c,rc,oc,Pd,{})}}export{hc as default,ac as metadata};
