import{s as bt,n as ct,o as _t}from"../chunks/scheduler.8a2cc2fa.js";import{S as gt,i as ht,e as r,s as i,c as m,h as ft,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.7079e750.js";import{C as ut,H as ae,E as vt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.53f94051.js";import{D as f}from"../chunks/Docstring.36694462.js";function yt(at){let u,pe,me,be,N,ce,L,_e,E,it='<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:',ge,W,nt="<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>",he,q,ot="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.",fe,M,ue,v,j,Ue,P,I,Re,ie,st="Base Adam optimizer.",ve,S,ye,y,V,Be,T,G,Oe,ne,rt="8-bit Adam optimizer.",$e,H,Ae,$,U,Je,k,R,Ke,oe,dt="32-bit Adam optimizer.",xe,B,we,A,O,Qe,F,J,Xe,se,mt="Paged Adam optimizer.",ze,K,Pe,x,Q,Ye,C,X,Ze,re,lt="8-bit paged Adam optimizer.",Te,Y,ke,w,Z,et,D,ee,tt,de,pt="Paged 32-bit Adam optimizer.",Fe,te,Ce,le,De;return N=new ut({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),L=new ae({props:{title:"Adam",local:"adam",headingTag:"h1"}}),M=new ae({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/main/bitsandbytes/optim/adam.py#L9"}}),I=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/main/bitsandbytes/optim/adam.py#L10"}}),S=new ae({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/main/bitsandbytes/optim/adam.py#L70"}}),G=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/main/bitsandbytes/optim/adam.py#L71"}}),H=new ae({props:{title:"Adam32bit",local:"bitsandbytes.optim.Adam32bit",headingTag:"h2"}}),U=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/main/bitsandbytes/optim/adam.py#L142"}}),R=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/main/bitsandbytes/optim/adam.py#L143"}}),B=new ae({props:{title:"PagedAdam",local:"bitsandbytes.optim.PagedAdam",headingTag:"h2"}}),O=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/main/bitsandbytes/optim/adam.py#L203"}}),J=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/main/bitsandbytes/optim/adam.py#L204"}}),K=new ae({props:{title:"PagedAdam8bit",local:"bitsandbytes.optim.PagedAdam8bit",headingTag:"h2"}}),Q=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/main/bitsandbytes/optim/adam.py#L264"}}),X=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/main/bitsandbytes/optim/adam.py#L265"}}),Y=new ae({props:{title:"PagedAdam32bit",local:"bitsandbytes.optim.PagedAdam32bit",headingTag:"h2"}}),Z=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/main/bitsandbytes/optim/adam.py#L336"}}),ee=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/main/bitsandbytes/optim/adam.py#L337"}}),te=new vt({props:{source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/reference/optim/adam.mdx"}}),{c(){u=r("meta"),pe=i(),me=r("p"),be=i(),m(N.$$.fragment),ce=i(),m(L.$$.fragment),_e=i(),E=r("p"),E.innerHTML=it,ge=i(),W=r("ul"),W.innerHTML=nt,he=i(),q=r("p"),q.textContent=ot,fe=i(),m(M.$$.fragment),ue=i(),v=r("div"),m(j.$$.fragment),Ue=i(),P=r("div"),m(I.$$.fragment),Re=i(),ie=r("p"),ie.textContent=st,ve=i(),m(S.$$.fragment),ye=i(),y=r("div"),m(V.$$.fragment),Be=i(),T=r("div"),m(G.$$.fragment),Oe=i(),ne=r("p"),ne.textContent=rt,$e=i(),m(H.$$.fragment),Ae=i(),$=r("div"),m(U.$$.fragment),Je=i(),k=r("div"),m(R.$$.fragment),Ke=i(),oe=r("p"),oe.textContent=dt,xe=i(),m(B.$$.fragment),we=i(),A=r("div"),m(O.$$.fragment),Qe=i(),F=r("div"),m(J.$$.fragment),Xe=i(),se=r("p"),se.textContent=mt,ze=i(),m(K.$$.fragment),Pe=i(),x=r("div"),m(Q.$$.fragment),Ye=i(),C=r("div"),m(X.$$.fragment),Ze=i(),re=r("p"),re.textContent=lt,Te=i(),m(Y.$$.fragment),ke=i(),w=r("div"),m(Z.$$.fragment),et=i(),D=r("div"),m(ee.$$.fragment),tt=i(),de=r("p"),de.textContent=pt,Fe=i(),m(te.$$.fragment),Ce=i(),le=r("p"),this.h()},l(e){const a=ft("svelte-u9bgzb",document.head);u=d(a,"META",{name:!0,content:!0}),a.forEach(t),pe=n(e),me=d(e,"P",{}),g(me).forEach(t),be=n(e),l(N.$$.fragment,e),ce=n(e),l(L.$$.fragment,e),_e=n(e),E=d(e,"P",{"data-svelte-h":!0}),z(E)!=="svelte-et5h9y"&&(E.innerHTML=it),ge=n(e),W=d(e,"UL",{"data-svelte-h":!0}),z(W)!=="svelte-1miac0o"&&(W.innerHTML=nt),he=n(e),q=d(e,"P",{"data-svelte-h":!0}),z(q)!=="svelte-qpasov"&&(q.textContent=ot),fe=n(e),l(M.$$.fragment,e),ue=n(e),v=d(e,"DIV",{class:!0});var Ne=g(v);l(j.$$.fragment,Ne),Ue=n(Ne),P=d(Ne,"DIV",{class:!0});var Le=g(P);l(I.$$.fragment,Le),Re=n(Le),ie=d(Le,"P",{"data-svelte-h":!0}),z(ie)!=="svelte-o3b8f9"&&(ie.textContent=st),Le.forEach(t),Ne.forEach(t),ve=n(e),l(S.$$.fragment,e),ye=n(e),y=d(e,"DIV",{class:!0});var Ee=g(y);l(V.$$.fragment,Ee),Be=n(Ee),T=d(Ee,"DIV",{class:!0});var We=g(T);l(G.$$.fragment,We),Oe=n(We),ne=d(We,"P",{"data-svelte-h":!0}),z(ne)!=="svelte-17h2o0s"&&(ne.textContent=rt),We.forEach(t),Ee.forEach(t),$e=n(e),l(H.$$.fragment,e),Ae=n(e),$=d(e,"DIV",{class:!0});var qe=g($);l(U.$$.fragment,qe),Je=n(qe),k=d(qe,"DIV",{class:!0});var Me=g(k);l(R.$$.fragment,Me),Ke=n(Me),oe=d(Me,"P",{"data-svelte-h":!0}),z(oe)!=="svelte-1x8tgev"&&(oe.textContent=dt),Me.forEach(t),qe.forEach(t),xe=n(e),l(B.$$.fragment,e),we=n(e),A=d(e,"DIV",{class:!0});var je=g(A);l(O.$$.fragment,je),Qe=n(je),F=d(je,"DIV",{class:!0});var Ie=g(F);l(J.$$.fragment,Ie),Xe=n(Ie),se=d(Ie,"P",{"data-svelte-h":!0}),z(se)!=="svelte-1a1nn0n"&&(se.textContent=mt),Ie.forEach(t),je.forEach(t),ze=n(e),l(K.$$.fragment,e),Pe=n(e),x=d(e,"DIV",{class:!0});var Se=g(x);l(Q.$$.fragment,Se),Ye=n(Se),C=d(Se,"DIV",{class:!0});var Ve=g(C);l(X.$$.fragment,Ve),Ze=n(Ve),re=d(Ve,"P",{"data-svelte-h":!0}),z(re)!=="svelte-12q2iox"&&(re.textContent=lt),Ve.forEach(t),Se.forEach(t),Te=n(e),l(Y.$$.fragment,e),ke=n(e),w=d(e,"DIV",{class:!0});var Ge=g(w);l(Z.$$.fragment,Ge),et=n(Ge),D=d(Ge,"DIV",{class:!0});var He=g(D);l(ee.$$.fragment,He),tt=n(He),de=d(He,"P",{"data-svelte-h":!0}),z(de)!=="svelte-1qxzzie"&&(de.textContent=pt),He.forEach(t),Ge.forEach(t),Fe=n(e),l(te.$$.fragment,e),Ce=n(e),le=d(e,"P",{}),g(le).forEach(t),this.h()},h(){h(u,"name","hf:doc:metadata"),h(u,"content",$t),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,pe,a),o(e,me,a),o(e,be,a),p(N,e,a),o(e,ce,a),p(L,e,a),o(e,_e,a),o(e,E,a),o(e,ge,a),o(e,W,a),o(e,he,a),o(e,q,a),o(e,fe,a),p(M,e,a),o(e,ue,a),o(e,v,a),p(j,v,null),s(v,Ue),s(v,P),p(I,P,null),s(P,Re),s(P,ie),o(e,ve,a),p(S,e,a),o(e,ye,a),o(e,y,a),p(V,y,null),s(y,Be),s(y,T),p(G,T,null),s(T,Oe),s(T,ne),o(e,$e,a),p(H,e,a),o(e,Ae,a),o(e,$,a),p(U,$,null),s($,Je),s($,k),p(R,k,null),s(k,Ke),s(k,oe),o(e,xe,a),p(B,e,a),o(e,we,a),o(e,A,a),p(O,A,null),s(A,Qe),s(A,F),p(J,F,null),s(F,Xe),s(F,se),o(e,ze,a),p(K,e,a),o(e,Pe,a),o(e,x,a),p(Q,x,null),s(x,Ye),s(x,C),p(X,C,null),s(C,Ze),s(C,re),o(e,Te,a),p(Y,e,a),o(e,ke,a),o(e,w,a),p(Z,w,null),s(w,et),s(w,D),p(ee,D,null),s(D,tt),s(D,de),o(e,Fe,a),p(te,e,a),o(e,Ce,a),o(e,le,a),De=!0},p:ct,i(e){De||(b(N.$$.fragment,e),b(L.$$.fragment,e),b(M.$$.fragment,e),b(j.$$.fragment,e),b(I.$$.fragment,e),b(S.$$.fragment,e),b(V.$$.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),b(te.$$.fragment,e),De=!0)},o(e){c(N.$$.fragment,e),c(L.$$.fragment,e),c(M.$$.fragment,e),c(j.$$.fragment,e),c(I.$$.fragment,e),c(S.$$.fragment,e),c(V.$$.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),c(te.$$.fragment,e),De=!1},d(e){e&&(t(pe),t(me),t(be),t(ce),t(_e),t(E),t(ge),t(W),t(he),t(q),t(fe),t(ue),t(v),t(ve),t(ye),t(y),t($e),t(Ae),t($),t(xe),t(we),t(A),t(ze),t(Pe),t(x),t(Te),t(ke),t(w),t(Fe),t(Ce),t(le)),t(u),_(N,e),_(L,e),_(M,e),_(j),_(I),_(S,e),_(V),_(G),_(H,e),_(U),_(R),_(B,e),_(O),_(J),_(K,e),_(Q),_(X),_(Y,e),_(Z),_(ee),_(te,e)}}}const $t='{"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 At(at){return _t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Tt extends gt{constructor(u){super(),ht(this,u,At,yt,bt,{})}}export{Tt as component};
