import{s as lt,n as pt,o as bt}from"../chunks/scheduler.44d8fc67.js";import{S as ct,i as _t,e as r,s as i,c as m,h as gt,a as d,d as t,b as n,f as g,g as l,j as z,k as h,l as s,m as o,n as p,t as b,o as c,p as _}from"../chunks/index.9e7b1f0b.js";import{D as f}from"../chunks/Docstring.98488101.js";import{H as te,E as ht}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c7c91191.js";function ft(et){let u,le,de,pe,N,be,E,tt='<a href="https://hf.co/papers/1412.6980" rel="nofollow">Adam (Adaptive moment estimation)</a> is an adaptive learning rate optimizer, combining ideas from <code>SGD</code> with momentum and <code>RMSprop</code> to automatically scale the learning rate:',ce,L,at="<li>a weighted average of the past gradients to provide direction (first-moment)</li> <li>a weighted average of the <em>squared</em> past gradients to adapt the learning rate to each parameter (second-moment)</li>",_e,W,it="bitsandbytes also supports paged optimizers which take advantage of CUDAs unified memory to transfer memory from the GPU to the CPU when GPU memory is exhausted.",ge,q,he,v,j,Ge,P,M,He,ae,nt="Base Adam optimizer.",fe,I,ue,y,V,Ue,T,S,Re,ie,ot="8-bit Adam optimizer.",ve,G,ye,$,H,Be,k,U,Oe,ne,st="32-bit Adam optimizer.",$e,R,Ae,A,B,Je,F,O,Ke,oe,rt="Paged Adam optimizer.",xe,J,we,x,K,Qe,C,Q,Xe,se,dt="8-bit paged Adam optimizer.",ze,X,Pe,w,Y,Ye,D,Z,Ze,re,mt="Paged 32-bit Adam optimizer.",Te,ee,ke,me,Fe;return N=new te({props:{title:"Adam",local:"adam",headingTag:"h1"}}),q=new te({props:{title:"Adam",local:"api-class ][ bitsandbytes.optim.Adam",headingTag:"h2"}}),j=new f({props:{name:"class bitsandbytes.optim.Adam",anchor:"bitsandbytes.optim.Adam",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L9"}}),M=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.Adam.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.Adam.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.Adam.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.Adam.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.Adam.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.Adam.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.Adam.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.Adam.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.Adam.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.Adam.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.Adam.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.Adam.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.Adam.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L10"}}),I=new te({props:{title:"Adam8bit",local:"bitsandbytes.optim.Adam8bit",headingTag:"h2"}}),V=new f({props:{name:"class bitsandbytes.optim.Adam8bit",anchor:"bitsandbytes.optim.Adam8bit",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L70"}}),S=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.Adam8bit.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.Adam8bit.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.
Note: This parameter is not supported in Adam8bit and must be False.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.
Note: This parameter is not used in Adam8bit as it always uses 8-bit optimization.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.Adam8bit.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L71"}}),G=new te({props:{title:"Adam32bit",local:"bitsandbytes.optim.Adam32bit",headingTag:"h2"}}),H=new f({props:{name:"class bitsandbytes.optim.Adam32bit",anchor:"bitsandbytes.optim.Adam32bit",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L142"}}),U=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.Adam32bit.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.Adam32bit.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.Adam32bit.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L143"}}),R=new te({props:{title:"PagedAdam",local:"bitsandbytes.optim.PagedAdam",headingTag:"h2"}}),B=new f({props:{name:"class bitsandbytes.optim.PagedAdam",anchor:"bitsandbytes.optim.PagedAdam",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L203"}}),O=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.PagedAdam.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.PagedAdam.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.PagedAdam.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L204"}}),J=new te({props:{title:"PagedAdam8bit",local:"bitsandbytes.optim.PagedAdam8bit",headingTag:"h2"}}),K=new f({props:{name:"class bitsandbytes.optim.PagedAdam8bit",anchor:"bitsandbytes.optim.PagedAdam8bit",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L264"}}),Q=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.PagedAdam8bit.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.
Note: This parameter is not supported in PagedAdam8bit and must be False.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.
Note: This parameter is not used in PagedAdam8bit as it always uses 8-bit optimization.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.PagedAdam8bit.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L265"}}),X=new te({props:{title:"PagedAdam32bit",local:"bitsandbytes.optim.PagedAdam32bit",headingTag:"h2"}}),Y=new f({props:{name:"class bitsandbytes.optim.PagedAdam32bit",anchor:"bitsandbytes.optim.PagedAdam32bit",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L336"}}),Z=new f({props:{name:"__init__",anchor:"bitsandbytes.optim.PagedAdam32bit.__init__",parameters:[{name:"params",val:""},{name:"lr",val:" = 0.001"},{name:"betas",val:" = (0.9, 0.999)"},{name:"eps",val:" = 1e-08"},{name:"weight_decay",val:" = 0"},{name:"amsgrad",val:" = False"},{name:"optim_bits",val:" = 32"},{name:"args",val:" = None"},{name:"min_8bit_size",val:" = 4096"},{name:"percentile_clipping",val:" = 100"},{name:"block_wise",val:" = True"},{name:"is_paged",val:" = False"}],parametersDescription:[{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.params",description:`<strong>params</strong> (<code>torch.tensor</code>) &#x2014;
The input parameters to optimize.`,name:"params"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.lr",description:`<strong>lr</strong> (<code>float</code>, defaults to 1e-3) &#x2014;
The learning rate.`,name:"lr"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.betas",description:`<strong>betas</strong> (<code>tuple(float, float)</code>, defaults to (0.9, 0.999)) &#x2014;
The beta values are the decay rates of the first and second-order moment of the optimizer.`,name:"betas"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.eps",description:`<strong>eps</strong> (<code>float</code>, defaults to 1e-8) &#x2014;
The epsilon value prevents division by zero in the optimizer.`,name:"eps"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.weight_decay",description:`<strong>weight_decay</strong> (<code>float</code>, defaults to 0.0) &#x2014;
The weight decay value for the optimizer.`,name:"weight_decay"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.amsgrad",description:`<strong>amsgrad</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether to use the <a href="https://hf.co/papers/1904.09237" rel="nofollow">AMSGrad</a> variant of Adam that uses the maximum of past squared gradients instead.`,name:"amsgrad"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.optim_bits",description:`<strong>optim_bits</strong> (<code>int</code>, defaults to 32) &#x2014;
The number of bits of the optimizer state.`,name:"optim_bits"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.args",description:`<strong>args</strong> (<code>object</code>, defaults to <code>None</code>) &#x2014;
An object with additional arguments.`,name:"args"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.min_8bit_size",description:`<strong>min_8bit_size</strong> (<code>int</code>, defaults to 4096) &#x2014;
The minimum number of elements of the parameter tensors for 8-bit optimization.`,name:"min_8bit_size"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.percentile_clipping",description:`<strong>percentile_clipping</strong> (<code>int</code>, defaults to 100) &#x2014;
Adapts clipping threshold automatically by tracking the last 100 gradient norms and clipping the gradient at a certain percentile to improve stability.`,name:"percentile_clipping"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.block_wise",description:`<strong>block_wise</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether to independently quantize each block of tensors to reduce outlier effects and improve stability.`,name:"block_wise"},{anchor:"bitsandbytes.optim.PagedAdam32bit.__init__.is_paged",description:`<strong>is_paged</strong> (<code>bool</code>, defaults to <code>False</code>) &#x2014;
Whether the optimizer is a paged optimizer or not.`,name:"is_paged"}],source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/v0.48.0/bitsandbytes/optim/adam.py#L337"}}),ee=new ht({props:{source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/reference/optim/adam.mdx"}}),{c(){u=r("meta"),le=i(),de=r("p"),pe=i(),m(N.$$.fragment),be=i(),E=r("p"),E.innerHTML=tt,ce=i(),L=r("ul"),L.innerHTML=at,_e=i(),W=r("p"),W.textContent=it,ge=i(),m(q.$$.fragment),he=i(),v=r("div"),m(j.$$.fragment),Ge=i(),P=r("div"),m(M.$$.fragment),He=i(),ae=r("p"),ae.textContent=nt,fe=i(),m(I.$$.fragment),ue=i(),y=r("div"),m(V.$$.fragment),Ue=i(),T=r("div"),m(S.$$.fragment),Re=i(),ie=r("p"),ie.textContent=ot,ve=i(),m(G.$$.fragment),ye=i(),$=r("div"),m(H.$$.fragment),Be=i(),k=r("div"),m(U.$$.fragment),Oe=i(),ne=r("p"),ne.textContent=st,$e=i(),m(R.$$.fragment),Ae=i(),A=r("div"),m(B.$$.fragment),Je=i(),F=r("div"),m(O.$$.fragment),Ke=i(),oe=r("p"),oe.textContent=rt,xe=i(),m(J.$$.fragment),we=i(),x=r("div"),m(K.$$.fragment),Qe=i(),C=r("div"),m(Q.$$.fragment),Xe=i(),se=r("p"),se.textContent=dt,ze=i(),m(X.$$.fragment),Pe=i(),w=r("div"),m(Y.$$.fragment),Ye=i(),D=r("div"),m(Z.$$.fragment),Ze=i(),re=r("p"),re.textContent=mt,Te=i(),m(ee.$$.fragment),ke=i(),me=r("p"),this.h()},l(e){const a=gt("svelte-u9bgzb",document.head);u=d(a,"META",{name:!0,content:!0}),a.forEach(t),le=n(e),de=d(e,"P",{}),g(de).forEach(t),pe=n(e),l(N.$$.fragment,e),be=n(e),E=d(e,"P",{"data-svelte-h":!0}),z(E)!=="svelte-et5h9y"&&(E.innerHTML=tt),ce=n(e),L=d(e,"UL",{"data-svelte-h":!0}),z(L)!=="svelte-1miac0o"&&(L.innerHTML=at),_e=n(e),W=d(e,"P",{"data-svelte-h":!0}),z(W)!=="svelte-qpasov"&&(W.textContent=it),ge=n(e),l(q.$$.fragment,e),he=n(e),v=d(e,"DIV",{class:!0});var Ce=g(v);l(j.$$.fragment,Ce),Ge=n(Ce),P=d(Ce,"DIV",{class:!0});var De=g(P);l(M.$$.fragment,De),He=n(De),ae=d(De,"P",{"data-svelte-h":!0}),z(ae)!=="svelte-o3b8f9"&&(ae.textContent=nt),De.forEach(t),Ce.forEach(t),fe=n(e),l(I.$$.fragment,e),ue=n(e),y=d(e,"DIV",{class:!0});var Ne=g(y);l(V.$$.fragment,Ne),Ue=n(Ne),T=d(Ne,"DIV",{class:!0});var Ee=g(T);l(S.$$.fragment,Ee),Re=n(Ee),ie=d(Ee,"P",{"data-svelte-h":!0}),z(ie)!=="svelte-17h2o0s"&&(ie.textContent=ot),Ee.forEach(t),Ne.forEach(t),ve=n(e),l(G.$$.fragment,e),ye=n(e),$=d(e,"DIV",{class:!0});var Le=g($);l(H.$$.fragment,Le),Be=n(Le),k=d(Le,"DIV",{class:!0});var We=g(k);l(U.$$.fragment,We),Oe=n(We),ne=d(We,"P",{"data-svelte-h":!0}),z(ne)!=="svelte-1x8tgev"&&(ne.textContent=st),We.forEach(t),Le.forEach(t),$e=n(e),l(R.$$.fragment,e),Ae=n(e),A=d(e,"DIV",{class:!0});var qe=g(A);l(B.$$.fragment,qe),Je=n(qe),F=d(qe,"DIV",{class:!0});var je=g(F);l(O.$$.fragment,je),Ke=n(je),oe=d(je,"P",{"data-svelte-h":!0}),z(oe)!=="svelte-1a1nn0n"&&(oe.textContent=rt),je.forEach(t),qe.forEach(t),xe=n(e),l(J.$$.fragment,e),we=n(e),x=d(e,"DIV",{class:!0});var Me=g(x);l(K.$$.fragment,Me),Qe=n(Me),C=d(Me,"DIV",{class:!0});var Ie=g(C);l(Q.$$.fragment,Ie),Xe=n(Ie),se=d(Ie,"P",{"data-svelte-h":!0}),z(se)!=="svelte-12q2iox"&&(se.textContent=dt),Ie.forEach(t),Me.forEach(t),ze=n(e),l(X.$$.fragment,e),Pe=n(e),w=d(e,"DIV",{class:!0});var Ve=g(w);l(Y.$$.fragment,Ve),Ye=n(Ve),D=d(Ve,"DIV",{class:!0});var Se=g(D);l(Z.$$.fragment,Se),Ze=n(Se),re=d(Se,"P",{"data-svelte-h":!0}),z(re)!=="svelte-1qxzzie"&&(re.textContent=mt),Se.forEach(t),Ve.forEach(t),Te=n(e),l(ee.$$.fragment,e),ke=n(e),me=d(e,"P",{}),g(me).forEach(t),this.h()},h(){h(u,"name","hf:doc:metadata"),h(u,"content",ut),h(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),h(w,"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,a){s(document.head,u),o(e,le,a),o(e,de,a),o(e,pe,a),p(N,e,a),o(e,be,a),o(e,E,a),o(e,ce,a),o(e,L,a),o(e,_e,a),o(e,W,a),o(e,ge,a),p(q,e,a),o(e,he,a),o(e,v,a),p(j,v,null),s(v,Ge),s(v,P),p(M,P,null),s(P,He),s(P,ae),o(e,fe,a),p(I,e,a),o(e,ue,a),o(e,y,a),p(V,y,null),s(y,Ue),s(y,T),p(S,T,null),s(T,Re),s(T,ie),o(e,ve,a),p(G,e,a),o(e,ye,a),o(e,$,a),p(H,$,null),s($,Be),s($,k),p(U,k,null),s(k,Oe),s(k,ne),o(e,$e,a),p(R,e,a),o(e,Ae,a),o(e,A,a),p(B,A,null),s(A,Je),s(A,F),p(O,F,null),s(F,Ke),s(F,oe),o(e,xe,a),p(J,e,a),o(e,we,a),o(e,x,a),p(K,x,null),s(x,Qe),s(x,C),p(Q,C,null),s(C,Xe),s(C,se),o(e,ze,a),p(X,e,a),o(e,Pe,a),o(e,w,a),p(Y,w,null),s(w,Ye),s(w,D),p(Z,D,null),s(D,Ze),s(D,re),o(e,Te,a),p(ee,e,a),o(e,ke,a),o(e,me,a),Fe=!0},p:pt,i(e){Fe||(b(N.$$.fragment,e),b(q.$$.fragment,e),b(j.$$.fragment,e),b(M.$$.fragment,e),b(I.$$.fragment,e),b(V.$$.fragment,e),b(S.$$.fragment,e),b(G.$$.fragment,e),b(H.$$.fragment,e),b(U.$$.fragment,e),b(R.$$.fragment,e),b(B.$$.fragment,e),b(O.$$.fragment,e),b(J.$$.fragment,e),b(K.$$.fragment,e),b(Q.$$.fragment,e),b(X.$$.fragment,e),b(Y.$$.fragment,e),b(Z.$$.fragment,e),b(ee.$$.fragment,e),Fe=!0)},o(e){c(N.$$.fragment,e),c(q.$$.fragment,e),c(j.$$.fragment,e),c(M.$$.fragment,e),c(I.$$.fragment,e),c(V.$$.fragment,e),c(S.$$.fragment,e),c(G.$$.fragment,e),c(H.$$.fragment,e),c(U.$$.fragment,e),c(R.$$.fragment,e),c(B.$$.fragment,e),c(O.$$.fragment,e),c(J.$$.fragment,e),c(K.$$.fragment,e),c(Q.$$.fragment,e),c(X.$$.fragment,e),c(Y.$$.fragment,e),c(Z.$$.fragment,e),c(ee.$$.fragment,e),Fe=!1},d(e){e&&(t(le),t(de),t(pe),t(be),t(E),t(ce),t(L),t(_e),t(W),t(ge),t(he),t(v),t(fe),t(ue),t(y),t(ve),t(ye),t($),t($e),t(Ae),t(A),t(xe),t(we),t(x),t(ze),t(Pe),t(w),t(Te),t(ke),t(me)),t(u),_(N,e),_(q,e),_(j),_(M),_(I,e),_(V),_(S),_(G,e),_(H),_(U),_(R,e),_(B),_(O),_(J,e),_(K),_(Q),_(X,e),_(Y),_(Z),_(ee,e)}}}const ut='{"title":"Adam","local":"adam","sections":[{"title":"Adam","local":"api-class ][ bitsandbytes.optim.Adam","sections":[],"depth":2},{"title":"Adam8bit","local":"bitsandbytes.optim.Adam8bit","sections":[],"depth":2},{"title":"Adam32bit","local":"bitsandbytes.optim.Adam32bit","sections":[],"depth":2},{"title":"PagedAdam","local":"bitsandbytes.optim.PagedAdam","sections":[],"depth":2},{"title":"PagedAdam8bit","local":"bitsandbytes.optim.PagedAdam8bit","sections":[],"depth":2},{"title":"PagedAdam32bit","local":"bitsandbytes.optim.PagedAdam32bit","sections":[],"depth":2}],"depth":1}';function vt(et){return bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wt extends ct{constructor(u){super(),_t(this,u,vt,ft,lt,{})}}export{wt as component};
