import{s as ue,n as pe,o as fe}from"../chunks/scheduler.182ea377.js";import{S as he,i as _e,g as i,s,r as T,A as ge,h as l,f as t,c as a,j as O,u as $,x as U,k as F,y as d,a as n,v as q,d as B,t as C,w as L}from"../chunks/index.abf12888.js";import{D as oe}from"../chunks/Docstring.93f6f462.js";import{H as ne}from"../chunks/Heading.16916d63.js";function be(se){let c,H,P,I,f,S,h,ae='The <a href="https://huggingface.co/papers/1505.04597" rel="nofollow">UNet</a> model was originally introduced by Ronneberger et al. for biomedical image segmentation, but it is also commonly used in 🤗 Diffusers because it outputs images that are the same size as the input. It is one of the most important components of a diffusion system because it facilitates the actual diffusion process. There are several variants of the UNet model in 🤗 Diffusers, depending on it’s number of dimensions and whether it is a conditional model or not. This is a 1D UNet model.',E,_,re="The abstract from the paper is:",A,g,ie='<em>There is large consent that successful training of deep networks requires many thousand annotated training samples. In this paper, we present a network and training strategy that relies on the strong use of data augmentation to use the available annotated samples more efficiently. The architecture consists of a contracting path to capture context and a symmetric expanding path that enables precise localization. We show that such a network can be trained end-to-end from very few images and outperforms the prior best method (a sliding-window convolutional network) on the ISBI challenge for segmentation of neuronal structures in electron microscopic stacks. Using the same network trained on transmitted light microscopy images (phase contrast and DIC) we won the ISBI cell tracking challenge 2015 in these categories by a large margin. Moreover, the network is fast. Segmentation of a 512x512 image takes less than a second on a recent GPU. The full implementation (based on Caffe) and the trained networks are available at <a href="http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net" rel="nofollow">http://lmb.informatik.uni-freiburg.de/people/ronneber/u-net</a>.</em>',V,b,W,r,D,X,w,le="A 1D UNet model that takes a noisy sample and a timestep and returns a sample shaped output.",Y,y,de=`This model inherits from <a href="/docs/diffusers/main/en/api/models/overview#diffusers.ModelMixin">ModelMixin</a>. Check the superclass documentation for it’s generic methods implemented
for all models (such as downloading or saving).`,Z,u,k,ee,x,ce='The <a href="/docs/diffusers/main/en/api/models/unet#diffusers.UNet1DModel">UNet1DModel</a> forward method.',R,N,j,m,v,te,M,me='The output of <a href="/docs/diffusers/main/en/api/models/unet#diffusers.UNet1DModel">UNet1DModel</a>.',G,z,J;return f=new ne({props:{title:"UNet1DModel",local:"unet1dmodel",headingTag:"h1"}}),b=new ne({props:{title:"UNet1DModel",local:"diffusers.UNet1DModel",headingTag:"h2"}}),D=new oe({props:{name:"class diffusers.UNet1DModel",anchor:"diffusers.UNet1DModel",parameters:[{name:"sample_size",val:": int = 65536"},{name:"sample_rate",val:": Optional = None"},{name:"in_channels",val:": int = 2"},{name:"out_channels",val:": int = 2"},{name:"extra_in_channels",val:": int = 0"},{name:"time_embedding_type",val:": str = 'fourier'"},{name:"flip_sin_to_cos",val:": bool = True"},{name:"use_timestep_embedding",val:": bool = False"},{name:"freq_shift",val:": float = 0.0"},{name:"down_block_types",val:": Tuple = ('DownBlock1DNoSkip', 'DownBlock1D', 'AttnDownBlock1D')"},{name:"up_block_types",val:": Tuple = ('AttnUpBlock1D', 'UpBlock1D', 'UpBlock1DNoSkip')"},{name:"mid_block_type",val:": Tuple = 'UNetMidBlock1D'"},{name:"out_block_type",val:": str = None"},{name:"block_out_channels",val:": Tuple = (32, 32, 64)"},{name:"act_fn",val:": str = None"},{name:"norm_num_groups",val:": int = 8"},{name:"layers_per_block",val:": int = 1"},{name:"downsample_each_block",val:": bool = False"}],parametersDescription:[{anchor:"diffusers.UNet1DModel.sample_size",description:"<strong>sample_size</strong> (<code>int</code>, <em>optional</em>) &#x2014; Default length of sample. Should be adaptable at runtime.",name:"sample_size"},{anchor:"diffusers.UNet1DModel.in_channels",description:"<strong>in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014; Number of channels in the input sample.",name:"in_channels"},{anchor:"diffusers.UNet1DModel.out_channels",description:"<strong>out_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014; Number of channels in the output.",name:"out_channels"},{anchor:"diffusers.UNet1DModel.extra_in_channels",description:`<strong>extra_in_channels</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
Number of additional channels to be added to the input of the first down block. Useful for cases where the
input data has more channels than what the model was initially designed for.`,name:"extra_in_channels"},{anchor:"diffusers.UNet1DModel.time_embedding_type",description:"<strong>time_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;fourier&quot;</code>) &#x2014; Type of time embedding to use.",name:"time_embedding_type"},{anchor:"diffusers.UNet1DModel.freq_shift",description:"<strong>freq_shift</strong> (<code>float</code>, <em>optional</em>, defaults to 0.0) &#x2014; Frequency shift for Fourier time embedding.",name:"freq_shift"},{anchor:"diffusers.UNet1DModel.flip_sin_to_cos",description:`<strong>flip_sin_to_cos</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to flip sin to cos for Fourier time embedding.`,name:"flip_sin_to_cos"},{anchor:"diffusers.UNet1DModel.down_block_types",description:`<strong>down_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;DownBlock1DNoSkip&quot;, &quot;DownBlock1D&quot;, &quot;AttnDownBlock1D&quot;)</code>) &#x2014;
Tuple of downsample block types.`,name:"down_block_types"},{anchor:"diffusers.UNet1DModel.up_block_types",description:`<strong>up_block_types</strong> (<code>Tuple[str]</code>, <em>optional</em>, defaults to <code>(&quot;AttnUpBlock1D&quot;, &quot;UpBlock1D&quot;, &quot;UpBlock1DNoSkip&quot;)</code>) &#x2014;
Tuple of upsample block types.`,name:"up_block_types"},{anchor:"diffusers.UNet1DModel.block_out_channels",description:`<strong>block_out_channels</strong> (<code>Tuple[int]</code>, <em>optional</em>, defaults to <code>(32, 32, 64)</code>) &#x2014;
Tuple of block output channels.`,name:"block_out_channels"},{anchor:"diffusers.UNet1DModel.mid_block_type",description:"<strong>mid_block_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;UNetMidBlock1D&quot;</code>) &#x2014; Block type for middle of UNet.",name:"mid_block_type"},{anchor:"diffusers.UNet1DModel.out_block_type",description:"<strong>out_block_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014; Optional output processing block of UNet.",name:"out_block_type"},{anchor:"diffusers.UNet1DModel.act_fn",description:"<strong>act_fn</strong> (<code>str</code>, <em>optional</em>, defaults to <code>None</code>) &#x2014; Optional activation function in UNet blocks.",name:"act_fn"},{anchor:"diffusers.UNet1DModel.norm_num_groups",description:"<strong>norm_num_groups</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014; The number of groups for normalization.",name:"norm_num_groups"},{anchor:"diffusers.UNet1DModel.layers_per_block",description:"<strong>layers_per_block</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014; The number of layers per block.",name:"layers_per_block"},{anchor:"diffusers.UNet1DModel.downsample_each_block",description:`<strong>downsample_each_block</strong> (<code>int</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Experimental feature for using a UNet without upsampling.`,name:"downsample_each_block"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/unet_1d.py#L41"}}),k=new oe({props:{name:"forward",anchor:"diffusers.UNet1DModel.forward",parameters:[{name:"sample",val:": FloatTensor"},{name:"timestep",val:": Union"},{name:"return_dict",val:": bool = True"}],parametersDescription:[{anchor:"diffusers.UNet1DModel.forward.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code>) &#x2014;
The noisy input tensor with the following shape <code>(batch_size, num_channels, sample_size)</code>.`,name:"sample"},{anchor:"diffusers.UNet1DModel.forward.timestep",description:"<strong>timestep</strong> (<code>torch.FloatTensor</code> or <code>float</code> or <code>int</code>) &#x2014; The number of timesteps to denoise an input.",name:"timestep"},{anchor:"diffusers.UNet1DModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to return a <code>~models.unet_1d.UNet1DOutput</code> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/unet_1d.py#L195",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>If <code>return_dict</code> is True, an <code>~models.unet_1d.UNet1DOutput</code> is returned, otherwise a <code>tuple</code> is
returned where the first element is the sample tensor.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>~models.unet_1d.UNet1DOutput</code> or <code>tuple</code></p>
`}}),N=new ne({props:{title:"UNet1DOutput",local:"diffusers.models.unets.unet_1d.UNet1DOutput",headingTag:"h2"}}),v=new oe({props:{name:"class diffusers.models.unets.unet_1d.UNet1DOutput",anchor:"diffusers.models.unets.unet_1d.UNet1DOutput",parameters:[{name:"sample",val:": FloatTensor"}],parametersDescription:[{anchor:"diffusers.models.unets.unet_1d.UNet1DOutput.sample",description:`<strong>sample</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_channels, sample_size)</code>) &#x2014;
The hidden states output from the last layer of the model.`,name:"sample"}],source:"https://github.com/huggingface/diffusers/blob/main/src/diffusers/models/unets/unet_1d.py#L28"}}),{c(){c=i("meta"),H=s(),P=i("p"),I=s(),T(f.$$.fragment),S=s(),h=i("p"),h.innerHTML=ae,E=s(),_=i("p"),_.textContent=re,A=s(),g=i("p"),g.innerHTML=ie,V=s(),T(b.$$.fragment),W=s(),r=i("div"),T(D.$$.fragment),X=s(),w=i("p"),w.textContent=le,Y=s(),y=i("p"),y.innerHTML=de,Z=s(),u=i("div"),T(k.$$.fragment),ee=s(),x=i("p"),x.innerHTML=ce,R=s(),T(N.$$.fragment),j=s(),m=i("div"),T(v.$$.fragment),te=s(),M=i("p"),M.innerHTML=me,G=s(),z=i("p"),this.h()},l(e){const o=ge("svelte-u9bgzb",document.head);c=l(o,"META",{name:!0,content:!0}),o.forEach(t),H=a(e),P=l(e,"P",{}),O(P).forEach(t),I=a(e),$(f.$$.fragment,e),S=a(e),h=l(e,"P",{"data-svelte-h":!0}),U(h)!=="svelte-1md5hd4"&&(h.innerHTML=ae),E=a(e),_=l(e,"P",{"data-svelte-h":!0}),U(_)!=="svelte-1cwsb16"&&(_.textContent=re),A=a(e),g=l(e,"P",{"data-svelte-h":!0}),U(g)!=="svelte-12epiox"&&(g.innerHTML=ie),V=a(e),$(b.$$.fragment,e),W=a(e),r=l(e,"DIV",{class:!0});var p=O(r);$(D.$$.fragment,p),X=a(p),w=l(p,"P",{"data-svelte-h":!0}),U(w)!=="svelte-1afci55"&&(w.textContent=le),Y=a(p),y=l(p,"P",{"data-svelte-h":!0}),U(y)!=="svelte-1hyu2ru"&&(y.innerHTML=de),Z=a(p),u=l(p,"DIV",{class:!0});var K=O(u);$(k.$$.fragment,K),ee=a(K),x=l(K,"P",{"data-svelte-h":!0}),U(x)!=="svelte-1nx8e33"&&(x.innerHTML=ce),K.forEach(t),p.forEach(t),R=a(e),$(N.$$.fragment,e),j=a(e),m=l(e,"DIV",{class:!0});var Q=O(m);$(v.$$.fragment,Q),te=a(Q),M=l(Q,"P",{"data-svelte-h":!0}),U(M)!=="svelte-dgf5oz"&&(M.innerHTML=me),Q.forEach(t),G=a(e),z=l(e,"P",{}),O(z).forEach(t),this.h()},h(){F(c,"name","hf:doc:metadata"),F(c,"content",De),F(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(r,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),F(m,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){d(document.head,c),n(e,H,o),n(e,P,o),n(e,I,o),q(f,e,o),n(e,S,o),n(e,h,o),n(e,E,o),n(e,_,o),n(e,A,o),n(e,g,o),n(e,V,o),q(b,e,o),n(e,W,o),n(e,r,o),q(D,r,null),d(r,X),d(r,w),d(r,Y),d(r,y),d(r,Z),d(r,u),q(k,u,null),d(u,ee),d(u,x),n(e,R,o),q(N,e,o),n(e,j,o),n(e,m,o),q(v,m,null),d(m,te),d(m,M),n(e,G,o),n(e,z,o),J=!0},p:pe,i(e){J||(B(f.$$.fragment,e),B(b.$$.fragment,e),B(D.$$.fragment,e),B(k.$$.fragment,e),B(N.$$.fragment,e),B(v.$$.fragment,e),J=!0)},o(e){C(f.$$.fragment,e),C(b.$$.fragment,e),C(D.$$.fragment,e),C(k.$$.fragment,e),C(N.$$.fragment,e),C(v.$$.fragment,e),J=!1},d(e){e&&(t(H),t(P),t(I),t(S),t(h),t(E),t(_),t(A),t(g),t(V),t(W),t(r),t(R),t(j),t(m),t(G),t(z)),t(c),L(f,e),L(b,e),L(D),L(k),L(N,e),L(v)}}}const De='{"title":"UNet1DModel","local":"unet1dmodel","sections":[{"title":"UNet1DModel","local":"diffusers.UNet1DModel","sections":[],"depth":2},{"title":"UNet1DOutput","local":"diffusers.models.unets.unet_1d.UNet1DOutput","sections":[],"depth":2}],"depth":1}';function ke(se){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ye extends he{constructor(c){super(),_e(this,c,ke,be,ue,{})}}export{ye as component};
