The function calls for these basis functions should be considered experimental and are subject to change without deprecation. However, the functions themselves are stable and can be freely used in combination with the other Layers and Models.
Construct a Chain of convolutional layers with normalization and activation functions.
Arguments
kernel_size: size of the convolutional kernel
in_chs: number of input channels
hidden_chs: dimensions of the hidden layers
activation: activation function
Keyword Arguments
norm_layer: Function with signature f(i::Integer, dims::Integer, act::F; kwargs...). i is the location of the layer in the model, dims is the channel dimension of the input, and act is the activation function. kwargs are forwarded from the norm_kwargs input, The function should return a normalization layer. Defaults to nothing, which means no normalization layer is used
conv_kwargs: keyword arguments for the convolutional layers
norm_kwargs: keyword arguments for the normalization layers
last_layer_activation: set to true to apply the activation function to the last layer
HamiltonianNN{FST}(model; autodiff=nothing) where {FST}
Constructs a Hamiltonian Neural Network (Greydanus et al., 2019). This neural network is useful for learning symmetries and conservation laws by supervision on the gradients of the trajectories. It takes as input a concatenated vector of length 2n containing the position (of size n) and momentum (of size n) of the particles. It then returns the time derivatives for position and momentum.
Arguments
FST: If true, then the type of the state returned by the model must be same as the type of the input state. See the documentation on StatefulLuxLayer for more information.
model: A Lux.AbstractLuxLayer neural network that returns the Hamiltonian of the system. The model must return a "batched scalar", i.e. all the dimensions of the output except the last one must be equal to 1. The last dimension must be equal to the batchsize of the input.
Keyword Arguments
autodiff: The autodiff framework to be used for the internal Hamiltonian computation. The default is nothing, which selects the best possible backend available. The available options are AutoForwardDiff and AutoZygote.
Autodiff Backends
autodiff
Package Needed
Notes
AutoZygote
Zygote.jl
Preferred Backend. Chosen if Zygote is loaded and autodiff is nothing.
AutoForwardDiff
Chosen if Zygote is not loaded and autodiff is nothing.
Note
This layer uses nested autodiff. Please refer to the manual entry on Nested Autodiff for more information and known limitations.
Construct a multi-layer perceptron (MLP) with dense layers, optional normalization layers, and dropout.
Arguments
in_dims: number of input dimensions
hidden_dims: dimensions of the hidden layers
activation: activation function (stacked after the normalization layer, if present else after the dense layer)
Keyword Arguments
norm_layer: Function with signature f(i::Integer, dims::Integer, act::F; kwargs...). i is the location of the layer in the model, dims is the channel dimension of the input, and act is the activation function. kwargs are forwarded from the norm_kwargs input, The function should return a normalization layer. Defaults to nothing, which means no normalization layer is used
dropout_rate: dropout rate (default: 0.0f0)
dense_kwargs: keyword arguments for the dense layers
norm_kwargs: keyword arguments for the normalization layers
last_layer_activation: set to true to apply the activation function to the last layer
Constructs a patch embedding layer with the given image size, patch size, input channels, and embedding planes. The patch size must be a divisor of the image size.
Arguments
image_size: image size as a tuple
patch_size: patch size as a tuple
in_channels: number of input channels
embed_planes: number of embedding planes
Keyword Arguments
norm_layer: Takes the embedding planes as input and returns a layer that normalizes the embedding planes. Defaults to no normalization.
flatten: set to true to flatten the output of the convolutional layer
Create an embedding periodic in some inputs with specified periods. Input indices not in idxs are passed through unchanged, but inputs in idxs are moved to the end of the output and replaced with their sines, followed by their cosines (scaled appropriately to have the specified periods). This smooth embedding preserves phase information and enforces periodicity.
For example, layer = PeriodicEmbedding([2, 3], [3.0, 1.0]) will create a layer periodic in the second input with period 3.0 and periodic in the third input with period 1.0. In this case, layer([a, b, c, d], st) == ([a, d, sinpi(2 / 3.0 * b), sinpi(2 / 1.0 * c), cospi(2 / 3.0 * b), cospi(2 / 1.0 * c)], st).
Arguments
idxs: Indices of the periodic inputs
periods: Periods of the periodic inputs, in the same order as in idxs
Inputs
x must be an AbstractArray with issubset(idxs, axes(x, 1))
st must be a NamedTuple where st.k = 2 ./ periods, but on the same device as x
Returns
AbstractArray of size (size(x, 1) + length(idxs), ...) where ... are the other dimensions of x.
Constructs a spline layer with the given basis function.
Arguments
in_dims: input dimensions of the layer. This must be a tuple of integers, to construct a flat vector of saved_points pass in ().
grid_min: minimum value of the grid.
grid_max: maximum value of the grid.
grid_step: step size of the grid.
basis: basis function to use for the interpolation. Currently only the basis functions from DataInterpolations.jl are supported:
ConstantInterpolation
LinearInterpolation
QuadraticInterpolation
QuadraticSpline
CubicSpline
Keyword Arguments
train_grid: whether to train the grid or not.
init_saved_points: values of the function at multiples of the time step. Initialized by default to a random vector sampled from the unit normal. Alternatively, can take a function with the signature init_saved_points(rng, in_dims, grid_min, grid_max, grid_step).
Warning
Currently this layer is limited since it relies on DataInterpolations.jl which doesn't work with GPU arrays. This will be fixed in the future by extending support to different basis functions.
This function is a convenience wrapper around ConvNormActivation that constructs a chain with norm_layer set to Lux.BatchNorm if use_norm is true and nothing otherwise. In most cases, users should use ConvNormActivation directly for a more flexible interface.
Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S. and others (2020). An image is worth 16x16 words: Transformers for image recognition at scale, arXiv preprint arXiv:2010.11929.
Greydanus, S.; Dzamba, M. and Yosinski, J. (2019). Hamiltonian neural networks. Advances in neural information processing systems 32.
+
+
+
+
\ No newline at end of file
diff --git a/previews/PR98/api/private.html b/previews/PR98/api/private.html
new file mode 100644
index 0000000..35620e4
--- /dev/null
+++ b/previews/PR98/api/private.html
@@ -0,0 +1,32 @@
+
+
+
+
+
+ Private API | Boltz.jl Docs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
In certain cases, to ensure type-stability we want to add type-asserts. But this won't work for exotic types like ForwardDiff.Dual. We use this function to check if we should add a type-assert for x.
Creates a Vision Transformer model with the specified configuration.
Arguments
name::Symbol: name of the Vision Transformer model to create. The following models are available – :tiny, :small, :base, :large, :huge, :giant, :gigantic.
Keyword Arguments
pretrained::Bool=false: If true, loads pretrained weights when LuxCore.setup is called.
You need to load JLD2 before being able to load pretrained weights.
Load Pretrained Weights
Pass pretrained=true to the model constructor to load the pretrained weights.
MODEL
TOP 1 ACCURACY (%)
TOP 5 ACCURACY (%)
AlexNet()
54.48
77.72
VGG(11)
67.35
87.91
VGG(13)
68.40
88.48
VGG(16)
70.24
89.80
VGG(19)
71.09
90.27
VGG(11; batchnorm=true)
69.09
88.94
VGG(13; batchnorm=true)
69.66
89.49
VGG(16; batchnorm=true)
72.11
91.02
VGG(19; batchnorm=true)
72.95
91.32
ResNet(18)
-
-
ResNet(34)
-
-
ResNet(50)
-
-
ResNet(101)
-
-
ResNet(152)
-
-
ResNeXt(50; cardinality=32, base_width=4)
-
-
ResNeXt(101; cardinality=32, base_width=8)
-
-
ResNeXt(101; cardinality=64, base_width=4)
-
-
SqueezeNet()
-
-
WideResNet(50)
-
-
WideResNet(101)
-
-
Pretrained Models from Metalhead
For Models imported from Metalhead, the pretrained weights can be loaded if they are available in Metalhead. Refer to the Metalhead.jl docs for a list of available pretrained models.
All the pretrained models require that the images be normalized with the parameters mean = [0.485f0, 0.456f0, 0.406f0] and std = [0.229f0, 0.224f0, 0.225f0].
He, K.; Zhang, X.; Ren, S. and Sun, J. (2016). Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 770–778.
Howard, A.; Sandler, M.; Chu, G.; Chen, L.-C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V. and others (2019). Searching for mobilenetv3. In: Proceedings of the IEEE/CVF international conference on computer vision; pp. 1314–1324.
Howard, A. G. (2017). MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications, arXiv preprint arXiv:1704.04861.
Huang, G.; Liu, Z.; Van Der Maaten, L. and Weinberger, K. Q. (2017). Densely connected convolutional networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 4700–4708.
Krizhevsky, A.; Sutskever, I. and Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25.
Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A. and Chen, L.-C. (2018). Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 4510–4520.
Simonyan, K. (2014). Very deep convolutional networks for large-scale image recognition, arXiv preprint arXiv:1409.1556.
Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V. and Rabinovich, A. (2015). Going deeper with convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 1–9.
Trockman, A. and Kolter, J. Z. (2022). Patches are all you need? arXiv preprint arXiv:2201.09792.
Xie, S.; Girshick, R.; Dollár, P.; Tu, Z. and He, K. (2017). Aggregated residual transformations for deep neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 1492–1500.
+
+
+
+
\ No newline at end of file
diff --git a/previews/PR98/assets/api_basis.md.D9oO8cm0.js b/previews/PR98/assets/api_basis.md.D9oO8cm0.js
new file mode 100644
index 0000000..1f9bb8c
--- /dev/null
+++ b/previews/PR98/assets/api_basis.md.D9oO8cm0.js
@@ -0,0 +1 @@
+import{_ as o,c as s,j as t,a as Q,G as n,a2 as a,B as d,o as e}from"./chunks/framework.BI0fNMXE.js";const O=JSON.parse('{"title":"Boltz.Basis API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/basis.md","filePath":"api/basis.md","lastUpdated":null}'),r={name:"api/basis.md"},m={class:"jldocstring custom-block",open:""},i={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},h={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"25.599ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 11314.7 1000","aria-hidden":"true"},p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"4.934ex",height:"2.363ex",role:"img",focusable:"false",viewBox:"0 -750 2181 1044.2","aria-hidden":"true"},H={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},u={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.462ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.619ex",height:"2.393ex",role:"img",focusable:"false",viewBox:"0 -853.7 1157.6 1057.7","aria-hidden":"true"},k={class:"jldocstring custom-block",open:""},w={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},y={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"28.038ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 12392.7 1000","aria-hidden":"true"},f={class:"jldocstring custom-block",open:""},c={class:"MathJax",jax:"SVG",display:"true",style:{direction:"ltr",display:"block","text-align":"center",margin:"1em 0",position:"relative"}},x={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-3.731ex"},xmlns:"http://www.w3.org/2000/svg",width:"31.946ex",height:"8.593ex",role:"img",focusable:"false",viewBox:"0 -2149 14120.1 3798","aria-hidden":"true"},V={class:"jldocstring custom-block",open:""},L={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},M={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"25.993ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 11488.7 1000","aria-hidden":"true"},b={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},Z={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"5.066ex",height:"2.363ex",role:"img",focusable:"false",viewBox:"0 -750 2239 1044.2","aria-hidden":"true"},v={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},C={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.462ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.619ex",height:"2.393ex",role:"img",focusable:"false",viewBox:"0 -853.7 1157.6 1057.7","aria-hidden":"true"},j={class:"jldocstring custom-block",open:""},A={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},D={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.461ex",height:"2.587ex",role:"img",focusable:"false",viewBox:"0 -893.3 6833.7 1143.3","aria-hidden":"true"},B={class:"jldocstring custom-block",open:""},_={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},E={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"27.291ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 12062.7 1000","aria-hidden":"true"};function S(F,T,P,I,R,N){const l=d("Badge");return e(),s("div",null,[T[82]||(T[82]=t("h1",{id:"Boltz.Basis-API-Reference",tabindex:"-1"},[t("code",null,"Boltz.Basis"),Q(" API Reference "),t("a",{class:"header-anchor",href:"#Boltz.Basis-API-Reference","aria-label":'Permalink to "`Boltz.Basis` API Reference {#Boltz.Basis-API-Reference}"'},"")],-1)),T[83]||(T[83]=t("div",{class:"warning custom-block"},[t("p",{class:"custom-block-title"},"Warning"),t("p",null,"The function calls for these basis functions should be considered experimental and are subject to change without deprecation. However, the functions themselves are stable and can be freely used in combination with the other Layers and Models.")],-1)),t("details",m,[t("summary",null,[T[0]||(T[0]=t("a",{id:"Boltz.Basis.Chebyshev-Tuple{Any}",href:"#Boltz.Basis.Chebyshev-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Chebyshev")],-1)),T[1]||(T[1]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[12]||(T[12]=a('
julia
Chebyshev(n; dim::Int=1)
',1)),t("p",null,[T[8]||(T[8]=Q("Constructs a Chebyshev basis of the form ")),t("mjx-container",i,[(e(),s("svg",h,T[2]||(T[2]=[a('',1)]))),T[3]||(T[3]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"0")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[9]||(T[9]=Q(" where ")),t("mjx-container",p,[(e(),s("svg",g,T[4]||(T[4]=[a('',1)]))),T[5]||(T[5]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mi",null,"T"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mo",null,"."),t("mo",{stretchy:"false"},")")])],-1))]),T[10]||(T[10]=Q(" is the ")),t("mjx-container",H,[(e(),s("svg",u,T[6]||(T[6]=[a('',1)]))),T[7]||(T[7]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msup",null,[t("mi",null,"j"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mi",null,"h")])])])],-1))]),T[11]||(T[11]=Q(" Chebyshev polynomial of the first kind."))]),T[13]||(T[13]=t("p",null,[t("strong",null,"Arguments")],-1)),T[14]||(T[14]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[15]||(T[15]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[16]||(T[16]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[17]||(T[17]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L49",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[T[18]||(T[18]=t("a",{id:"Boltz.Basis.Cos-Tuple{Any}",href:"#Boltz.Basis.Cos-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Cos")],-1)),T[19]||(T[19]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[24]||(T[24]=a('
julia
Cos(n; dim::Int=1)
',1)),t("p",null,[T[22]||(T[22]=Q("Constructs a cosine basis of the form ")),t("mjx-container",w,[(e(),s("svg",y,T[20]||(T[20]=[a('',1)]))),T[21]||(T[21]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mn",null,"2"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[23]||(T[23]=Q("."))]),T[25]||(T[25]=t("p",null,[t("strong",null,"Arguments")],-1)),T[26]||(T[26]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the cosine expansion.")])],-1)),T[27]||(T[27]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[28]||(T[28]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[29]||(T[29]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L84",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",f,[t("summary",null,[T[30]||(T[30]=t("a",{id:"Boltz.Basis.Fourier-Tuple{Any}",href:"#Boltz.Basis.Fourier-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Fourier")],-1)),T[31]||(T[31]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[34]||(T[34]=a('
julia
Fourier(n; dim=1)
Constructs a Fourier basis of the form
',2)),t("mjx-container",c,[(e(),s("svg",x,T[32]||(T[32]=[a('',1)]))),T[33]||(T[33]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("msub",null,[t("mi",null,"F"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"{"),t("mtable",{columnalign:"left left",columnspacing:"1em",rowspacing:".2em"},[t("mtr",null,[t("mtd",null,[t("mi",null,"c"),t("mi",null,"o"),t("mi",null,"s"),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mi",null,"j"),t("mn",null,"2")]),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"CLOSE"},")")])]),t("mtd",null,[t("mtext",null,"if "),t("mi",null,"j"),t("mtext",null," is even")])]),t("mtr",null,[t("mtd",null,[t("mi",null,"s"),t("mi",null,"i"),t("mi",null,"n"),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mi",null,"j"),t("mn",null,"2")]),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"CLOSE"},")")])]),t("mtd",null,[t("mtext",null,"if "),t("mi",null,"j"),t("mtext",null," is odd")])])]),t("mo",{"data-mjx-texclass":"CLOSE",fence:"true",stretchy:"true",symmetric:"true"})])])],-1))]),T[35]||(T[35]=t("p",null,[t("strong",null,"Arguments")],-1)),T[36]||(T[36]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the Fourier expansion.")])],-1)),T[37]||(T[37]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[38]||(T[38]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[39]||(T[39]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L101",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",V,[t("summary",null,[T[40]||(T[40]=t("a",{id:"Boltz.Basis.Legendre-Tuple{Any}",href:"#Boltz.Basis.Legendre-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Legendre")],-1)),T[41]||(T[41]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[52]||(T[52]=a('
julia
Legendre(n; dim::Int=1)
',1)),t("p",null,[T[48]||(T[48]=Q("Constructs a Legendre basis of the form ")),t("mjx-container",L,[(e(),s("svg",M,T[42]||(T[42]=[a('',1)]))),T[43]||(T[43]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"0")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[49]||(T[49]=Q(" where ")),t("mjx-container",b,[(e(),s("svg",Z,T[44]||(T[44]=[a('',1)]))),T[45]||(T[45]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mi",null,"P"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mo",null,"."),t("mo",{stretchy:"false"},")")])],-1))]),T[50]||(T[50]=Q(" is the ")),t("mjx-container",v,[(e(),s("svg",C,T[46]||(T[46]=[a('',1)]))),T[47]||(T[47]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msup",null,[t("mi",null,"j"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mi",null,"h")])])])],-1))]),T[51]||(T[51]=Q(" Legendre polynomial."))]),T[53]||(T[53]=t("p",null,[t("strong",null,"Arguments")],-1)),T[54]||(T[54]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[55]||(T[55]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[56]||(T[56]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[57]||(T[57]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L140",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",j,[t("summary",null,[T[58]||(T[58]=t("a",{id:"Boltz.Basis.Polynomial-Tuple{Any}",href:"#Boltz.Basis.Polynomial-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Polynomial")],-1)),T[59]||(T[59]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[64]||(T[64]=a('
julia
Polynomial(n; dim::Int=1)
',1)),t("p",null,[T[62]||(T[62]=Q("Constructs a Polynomial basis of the form ")),t("mjx-container",A,[(e(),s("svg",D,T[60]||(T[60]=[a('',1)]))),T[61]||(T[61]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mn",null,"1"),t("mo",null,","),t("mi",null,"x"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msup",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1"),t("mo",{stretchy:"false"},")")])]),t("mo",{stretchy:"false"},"]")])],-1))]),T[63]||(T[63]=Q("."))]),T[65]||(T[65]=t("p",null,[t("strong",null,"Arguments")],-1)),T[66]||(T[66]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[67]||(T[67]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[68]||(T[68]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[69]||(T[69]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L172",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",B,[t("summary",null,[T[70]||(T[70]=t("a",{id:"Boltz.Basis.Sin-Tuple{Any}",href:"#Boltz.Basis.Sin-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Sin")],-1)),T[71]||(T[71]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[76]||(T[76]=a('
julia
Sin(n; dim::Int=1)
',1)),t("p",null,[T[74]||(T[74]=Q("Constructs a sine basis of the form ")),t("mjx-container",_,[(e(),s("svg",E,T[72]||(T[72]=[a('',1)]))),T[73]||(T[73]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mn",null,"2"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[75]||(T[75]=Q("."))]),T[77]||(T[77]=t("p",null,[t("strong",null,"Arguments")],-1)),T[78]||(T[78]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the sine expansion.")])],-1)),T[79]||(T[79]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[80]||(T[80]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[81]||(T[81]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L67",target:"_blank",rel:"noreferrer"},"source")],-1))])])}const G=o(r,[["render",S]]);export{O as __pageData,G as default};
diff --git a/previews/PR98/assets/api_basis.md.D9oO8cm0.lean.js b/previews/PR98/assets/api_basis.md.D9oO8cm0.lean.js
new file mode 100644
index 0000000..6c500a3
--- /dev/null
+++ b/previews/PR98/assets/api_basis.md.D9oO8cm0.lean.js
@@ -0,0 +1 @@
+import{_ as o,c as s,j as t,a as Q,G as n,a2 as a,B as d,o as e}from"./chunks/framework.BI0fNMXE.js";const O=JSON.parse('{"title":"Boltz.Basis API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/basis.md","filePath":"api/basis.md","lastUpdated":null}'),r={name:"api/basis.md"},m={class:"jldocstring custom-block",open:""},i={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},h={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"25.599ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 11314.7 1000","aria-hidden":"true"},p={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},g={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"4.934ex",height:"2.363ex",role:"img",focusable:"false",viewBox:"0 -750 2181 1044.2","aria-hidden":"true"},H={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},u={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.462ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.619ex",height:"2.393ex",role:"img",focusable:"false",viewBox:"0 -853.7 1157.6 1057.7","aria-hidden":"true"},k={class:"jldocstring custom-block",open:""},w={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},y={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"28.038ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 12392.7 1000","aria-hidden":"true"},f={class:"jldocstring custom-block",open:""},c={class:"MathJax",jax:"SVG",display:"true",style:{direction:"ltr",display:"block","text-align":"center",margin:"1em 0",position:"relative"}},x={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-3.731ex"},xmlns:"http://www.w3.org/2000/svg",width:"31.946ex",height:"8.593ex",role:"img",focusable:"false",viewBox:"0 -2149 14120.1 3798","aria-hidden":"true"},V={class:"jldocstring custom-block",open:""},L={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},M={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"25.993ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 11488.7 1000","aria-hidden":"true"},b={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},Z={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.666ex"},xmlns:"http://www.w3.org/2000/svg",width:"5.066ex",height:"2.363ex",role:"img",focusable:"false",viewBox:"0 -750 2239 1044.2","aria-hidden":"true"},v={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},C={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.462ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.619ex",height:"2.393ex",role:"img",focusable:"false",viewBox:"0 -853.7 1157.6 1057.7","aria-hidden":"true"},j={class:"jldocstring custom-block",open:""},A={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},D={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.461ex",height:"2.587ex",role:"img",focusable:"false",viewBox:"0 -893.3 6833.7 1143.3","aria-hidden":"true"},B={class:"jldocstring custom-block",open:""},_={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},E={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"27.291ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 12062.7 1000","aria-hidden":"true"};function S(F,T,P,I,R,N){const l=d("Badge");return e(),s("div",null,[T[82]||(T[82]=t("h1",{id:"Boltz.Basis-API-Reference",tabindex:"-1"},[t("code",null,"Boltz.Basis"),Q(" API Reference "),t("a",{class:"header-anchor",href:"#Boltz.Basis-API-Reference","aria-label":'Permalink to "`Boltz.Basis` API Reference {#Boltz.Basis-API-Reference}"'},"")],-1)),T[83]||(T[83]=t("div",{class:"warning custom-block"},[t("p",{class:"custom-block-title"},"Warning"),t("p",null,"The function calls for these basis functions should be considered experimental and are subject to change without deprecation. However, the functions themselves are stable and can be freely used in combination with the other Layers and Models.")],-1)),t("details",m,[t("summary",null,[T[0]||(T[0]=t("a",{id:"Boltz.Basis.Chebyshev-Tuple{Any}",href:"#Boltz.Basis.Chebyshev-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Chebyshev")],-1)),T[1]||(T[1]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[12]||(T[12]=a("",1)),t("p",null,[T[8]||(T[8]=Q("Constructs a Chebyshev basis of the form ")),t("mjx-container",i,[(e(),s("svg",h,T[2]||(T[2]=[a("",1)]))),T[3]||(T[3]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"0")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"T"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[9]||(T[9]=Q(" where ")),t("mjx-container",p,[(e(),s("svg",g,T[4]||(T[4]=[a("",1)]))),T[5]||(T[5]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mi",null,"T"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mo",null,"."),t("mo",{stretchy:"false"},")")])],-1))]),T[10]||(T[10]=Q(" is the ")),t("mjx-container",H,[(e(),s("svg",u,T[6]||(T[6]=[a("",1)]))),T[7]||(T[7]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msup",null,[t("mi",null,"j"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mi",null,"h")])])])],-1))]),T[11]||(T[11]=Q(" Chebyshev polynomial of the first kind."))]),T[13]||(T[13]=t("p",null,[t("strong",null,"Arguments")],-1)),T[14]||(T[14]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[15]||(T[15]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[16]||(T[16]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[17]||(T[17]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L49",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[T[18]||(T[18]=t("a",{id:"Boltz.Basis.Cos-Tuple{Any}",href:"#Boltz.Basis.Cos-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Cos")],-1)),T[19]||(T[19]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[24]||(T[24]=a("",1)),t("p",null,[T[22]||(T[22]=Q("Constructs a cosine basis of the form ")),t("mjx-container",w,[(e(),s("svg",y,T[20]||(T[20]=[a("",1)]))),T[21]||(T[21]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mn",null,"2"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("mi",null,"cos"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[23]||(T[23]=Q("."))]),T[25]||(T[25]=t("p",null,[t("strong",null,"Arguments")],-1)),T[26]||(T[26]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the cosine expansion.")])],-1)),T[27]||(T[27]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[28]||(T[28]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[29]||(T[29]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L84",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",f,[t("summary",null,[T[30]||(T[30]=t("a",{id:"Boltz.Basis.Fourier-Tuple{Any}",href:"#Boltz.Basis.Fourier-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Fourier")],-1)),T[31]||(T[31]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[34]||(T[34]=a("",2)),t("mjx-container",c,[(e(),s("svg",x,T[32]||(T[32]=[a("",1)]))),T[33]||(T[33]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("msub",null,[t("mi",null,"F"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"{"),t("mtable",{columnalign:"left left",columnspacing:"1em",rowspacing:".2em"},[t("mtr",null,[t("mtd",null,[t("mi",null,"c"),t("mi",null,"o"),t("mi",null,"s"),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mi",null,"j"),t("mn",null,"2")]),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"CLOSE"},")")])]),t("mtd",null,[t("mtext",null,"if "),t("mi",null,"j"),t("mtext",null," is even")])]),t("mtr",null,[t("mtd",null,[t("mi",null,"s"),t("mi",null,"i"),t("mi",null,"n"),t("mrow",{"data-mjx-texclass":"INNER"},[t("mo",{"data-mjx-texclass":"OPEN"},"("),t("mfrac",null,[t("mi",null,"j"),t("mn",null,"2")]),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"CLOSE"},")")])]),t("mtd",null,[t("mtext",null,"if "),t("mi",null,"j"),t("mtext",null," is odd")])])]),t("mo",{"data-mjx-texclass":"CLOSE",fence:"true",stretchy:"true",symmetric:"true"})])])],-1))]),T[35]||(T[35]=t("p",null,[t("strong",null,"Arguments")],-1)),T[36]||(T[36]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the Fourier expansion.")])],-1)),T[37]||(T[37]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[38]||(T[38]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[39]||(T[39]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L101",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",V,[t("summary",null,[T[40]||(T[40]=t("a",{id:"Boltz.Basis.Legendre-Tuple{Any}",href:"#Boltz.Basis.Legendre-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Legendre")],-1)),T[41]||(T[41]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[52]||(T[52]=a("",1)),t("p",null,[T[48]||(T[48]=Q("Constructs a Legendre basis of the form ")),t("mjx-container",L,[(e(),s("svg",M,T[42]||(T[42]=[a("",1)]))),T[43]||(T[43]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"0")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"P"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1")])]),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[49]||(T[49]=Q(" where ")),t("mjx-container",b,[(e(),s("svg",Z,T[44]||(T[44]=[a("",1)]))),T[45]||(T[45]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mi",null,"P"),t("mi",null,"j")]),t("mo",{stretchy:"false"},"("),t("mo",null,"."),t("mo",{stretchy:"false"},")")])],-1))]),T[50]||(T[50]=Q(" is the ")),t("mjx-container",v,[(e(),s("svg",C,T[46]||(T[46]=[a("",1)]))),T[47]||(T[47]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msup",null,[t("mi",null,"j"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mi",null,"h")])])])],-1))]),T[51]||(T[51]=Q(" Legendre polynomial."))]),T[53]||(T[53]=t("p",null,[t("strong",null,"Arguments")],-1)),T[54]||(T[54]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[55]||(T[55]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[56]||(T[56]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[57]||(T[57]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L140",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",j,[t("summary",null,[T[58]||(T[58]=t("a",{id:"Boltz.Basis.Polynomial-Tuple{Any}",href:"#Boltz.Basis.Polynomial-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Polynomial")],-1)),T[59]||(T[59]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[64]||(T[64]=a("",1)),t("p",null,[T[62]||(T[62]=Q("Constructs a Polynomial basis of the form ")),t("mjx-container",A,[(e(),s("svg",D,T[60]||(T[60]=[a("",1)]))),T[61]||(T[61]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mn",null,"1"),t("mo",null,","),t("mi",null,"x"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msup",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mo",null,"−"),t("mn",null,"1"),t("mo",{stretchy:"false"},")")])]),t("mo",{stretchy:"false"},"]")])],-1))]),T[63]||(T[63]=Q("."))]),T[65]||(T[65]=t("p",null,[t("strong",null,"Arguments")],-1)),T[66]||(T[66]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the polynomial expansion.")])],-1)),T[67]||(T[67]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[68]||(T[68]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[69]||(T[69]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L172",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",B,[t("summary",null,[T[70]||(T[70]=t("a",{id:"Boltz.Basis.Sin-Tuple{Any}",href:"#Boltz.Basis.Sin-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Basis.Sin")],-1)),T[71]||(T[71]=Q()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),T[76]||(T[76]=a("",1)),t("p",null,[T[74]||(T[74]=Q("Constructs a sine basis of the form ")),t("mjx-container",_,[(e(),s("svg",E,T[72]||(T[72]=[a("",1)]))),T[73]||(T[73]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("mo",{stretchy:"false"},"["),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mn",null,"2"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("mi",null,"sin"),t("mo",{"data-mjx-texclass":"NONE"},""),t("mo",{stretchy:"false"},"("),t("mi",null,"n"),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",{stretchy:"false"},"]")])],-1))]),T[75]||(T[75]=Q("."))]),T[77]||(T[77]=t("p",null,[t("strong",null,"Arguments")],-1)),T[78]||(T[78]=t("ul",null,[t("li",null,[t("code",null,"n"),Q(": number of terms in the sine expansion.")])],-1)),T[79]||(T[79]=t("p",null,[t("strong",null,"Keyword Arguments")],-1)),T[80]||(T[80]=t("ul",null,[t("li",null,[t("code",null,"dim::Int=1"),Q(": The dimension along which the basis functions are applied.")])],-1)),T[81]||(T[81]=t("p",null,[t("a",{href:"https://github.com/LuxDL/Boltz.jl/blob/6562f7afdce5b360ef02bce0937da69b6a04d2b3/src/basis.jl#L67",target:"_blank",rel:"noreferrer"},"source")],-1))])])}const G=o(r,[["render",S]]);export{O as __pageData,G as default};
diff --git a/previews/PR98/assets/api_index.md.Huv0Y-72.js b/previews/PR98/assets/api_index.md.Huv0Y-72.js
new file mode 100644
index 0000000..b076895
--- /dev/null
+++ b/previews/PR98/assets/api_index.md.Huv0Y-72.js
@@ -0,0 +1 @@
+import{_ as o,c as i,a2 as a,o as l}from"./chunks/framework.BI0fNMXE.js";const h=JSON.parse('{"title":"API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/index.md","filePath":"api/index.md","lastUpdated":null}'),t={name:"api/index.md"};function r(s,e,n,d,c,B){return l(),i("div",null,e[0]||(e[0]=[a('
Construct a Chain of convolutional layers with normalization and activation functions.
Arguments
kernel_size: size of the convolutional kernel
in_chs: number of input channels
hidden_chs: dimensions of the hidden layers
activation: activation function
Keyword Arguments
norm_layer: Function with signature f(i::Integer, dims::Integer, act::F; kwargs...). i is the location of the layer in the model, dims is the channel dimension of the input, and act is the activation function. kwargs are forwarded from the norm_kwargs input, The function should return a normalization layer. Defaults to nothing, which means no normalization layer is used
conv_kwargs: keyword arguments for the convolutional layers
norm_kwargs: keyword arguments for the normalization layers
last_layer_activation: set to true to apply the activation function to the last layer
HamiltonianNN{FST}(model; autodiff=nothing) where {FST}
Constructs a Hamiltonian Neural Network (Greydanus et al., 2019). This neural network is useful for learning symmetries and conservation laws by supervision on the gradients of the trajectories. It takes as input a concatenated vector of length 2n containing the position (of size n) and momentum (of size n) of the particles. It then returns the time derivatives for position and momentum.
Arguments
FST: If true, then the type of the state returned by the model must be same as the type of the input state. See the documentation on StatefulLuxLayer for more information.
model: A Lux.AbstractLuxLayer neural network that returns the Hamiltonian of the system. The model must return a "batched scalar", i.e. all the dimensions of the output except the last one must be equal to 1. The last dimension must be equal to the batchsize of the input.
Keyword Arguments
autodiff: The autodiff framework to be used for the internal Hamiltonian computation. The default is nothing, which selects the best possible backend available. The available options are AutoForwardDiff and AutoZygote.
Autodiff Backends
autodiff
Package Needed
Notes
AutoZygote
Zygote.jl
Preferred Backend. Chosen if Zygote is loaded and autodiff is nothing.
AutoForwardDiff
Chosen if Zygote is not loaded and autodiff is nothing.
Note
This layer uses nested autodiff. Please refer to the manual entry on Nested Autodiff for more information and known limitations.
Construct a multi-layer perceptron (MLP) with dense layers, optional normalization layers, and dropout.
Arguments
in_dims: number of input dimensions
hidden_dims: dimensions of the hidden layers
activation: activation function (stacked after the normalization layer, if present else after the dense layer)
Keyword Arguments
norm_layer: Function with signature f(i::Integer, dims::Integer, act::F; kwargs...). i is the location of the layer in the model, dims is the channel dimension of the input, and act is the activation function. kwargs are forwarded from the norm_kwargs input, The function should return a normalization layer. Defaults to nothing, which means no normalization layer is used
dropout_rate: dropout rate (default: 0.0f0)
dense_kwargs: keyword arguments for the dense layers
norm_kwargs: keyword arguments for the normalization layers
last_layer_activation: set to true to apply the activation function to the last layer
Constructs a patch embedding layer with the given image size, patch size, input channels, and embedding planes. The patch size must be a divisor of the image size.
Arguments
image_size: image size as a tuple
patch_size: patch size as a tuple
in_channels: number of input channels
embed_planes: number of embedding planes
Keyword Arguments
norm_layer: Takes the embedding planes as input and returns a layer that normalizes the embedding planes. Defaults to no normalization.
flatten: set to true to flatten the output of the convolutional layer
Create an embedding periodic in some inputs with specified periods. Input indices not in idxs are passed through unchanged, but inputs in idxs are moved to the end of the output and replaced with their sines, followed by their cosines (scaled appropriately to have the specified periods). This smooth embedding preserves phase information and enforces periodicity.
For example, layer = PeriodicEmbedding([2, 3], [3.0, 1.0]) will create a layer periodic in the second input with period 3.0 and periodic in the third input with period 1.0. In this case, layer([a, b, c, d], st) == ([a, d, sinpi(2 / 3.0 * b), sinpi(2 / 1.0 * c), cospi(2 / 3.0 * b), cospi(2 / 1.0 * c)], st).
Arguments
idxs: Indices of the periodic inputs
periods: Periods of the periodic inputs, in the same order as in idxs
Inputs
x must be an AbstractArray with issubset(idxs, axes(x, 1))
st must be a NamedTuple where st.k = 2 ./ periods, but on the same device as x
Returns
AbstractArray of size (size(x, 1) + length(idxs), ...) where ... are the other dimensions of x.
Constructs a spline layer with the given basis function.
Arguments
in_dims: input dimensions of the layer. This must be a tuple of integers, to construct a flat vector of saved_points pass in ().
grid_min: minimum value of the grid.
grid_max: maximum value of the grid.
grid_step: step size of the grid.
basis: basis function to use for the interpolation. Currently only the basis functions from DataInterpolations.jl are supported:
ConstantInterpolation
LinearInterpolation
QuadraticInterpolation
QuadraticSpline
CubicSpline
Keyword Arguments
train_grid: whether to train the grid or not.
init_saved_points: values of the function at multiples of the time step. Initialized by default to a random vector sampled from the unit normal. Alternatively, can take a function with the signature init_saved_points(rng, in_dims, grid_min, grid_max, grid_step).
Warning
Currently this layer is limited since it relies on DataInterpolations.jl which doesn't work with GPU arrays. This will be fixed in the future by extending support to different basis functions.
`,7))]),s("details",M,[s("summary",null,[i[60]||(i[60]=s("a",{id:"Boltz.Layers.ConvBatchNormActivation-Union{Tuple{F}, Tuple{NTuple{N, Int64} where N, Pair{Int64, Int64}, Int64, F}} where F",href:"#Boltz.Layers.ConvBatchNormActivation-Union{Tuple{F}, Tuple{NTuple{N, Int64} where N, Pair{Int64, Int64}, Int64, F}} where F"},[s("span",{class:"jlbinding"},"Boltz.Layers.ConvBatchNormActivation")],-1)),i[61]||(i[61]=a()),n(e,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),i[62]||(i[62]=t(`
This function is a convenience wrapper around ConvNormActivation that constructs a chain with norm_layer set to Lux.BatchNorm if use_norm is true and nothing otherwise. In most cases, users should use ConvNormActivation directly for a more flexible interface.
Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S. and others (2020). An image is worth 16x16 words: Transformers for image recognition at scale, arXiv preprint arXiv:2010.11929.
Greydanus, S.; Dzamba, M. and Yosinski, J. (2019). Hamiltonian neural networks. Advances in neural information processing systems 32.
',3))])}const O=p(o,[["render",V]]);export{R as __pageData,O as default};
diff --git a/previews/PR98/assets/api_layers.md.DmVxh5An.lean.js b/previews/PR98/assets/api_layers.md.DmVxh5An.lean.js
new file mode 100644
index 0000000..9eb3cf2
--- /dev/null
+++ b/previews/PR98/assets/api_layers.md.DmVxh5An.lean.js
@@ -0,0 +1 @@
+import{_ as p,c as l,j as s,a,G as n,a2 as t,B as r,o as h}from"./chunks/framework.BI0fNMXE.js";const R=JSON.parse('{"title":"Boltz.Layers API Reference","description":"","frontmatter":{},"headers":[],"relativePath":"api/layers.md","filePath":"api/layers.md","lastUpdated":null}'),o={name:"api/layers.md"},d={class:"jldocstring custom-block",open:""},k={class:"jldocstring custom-block",open:""},T={class:"jldocstring custom-block",open:""},Q={class:"jldocstring custom-block",open:""},g={class:"jldocstring custom-block",open:""},y={class:"jldocstring custom-block",open:""},m={class:"jldocstring custom-block",open:""},c={class:"jldocstring custom-block",open:""},E={class:"jldocstring custom-block",open:""},u={class:"jldocstring custom-block",open:""},F={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},f={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"15.579ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 6886 1000","aria-hidden":"true"},b={class:"MathJax",jax:"SVG",display:"true",style:{direction:"ltr",display:"block","text-align":"center",margin:"1em 0",position:"relative"}},C={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.65ex"},xmlns:"http://www.w3.org/2000/svg",width:"44.107ex",height:"2.347ex",role:"img",focusable:"false",viewBox:"0 -750 19495.1 1037.2","aria-hidden":"true"},_={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},L={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.05ex"},xmlns:"http://www.w3.org/2000/svg",width:"2.371ex",height:"1.595ex",role:"img",focusable:"false",viewBox:"0 -683 1048 705","aria-hidden":"true"},x={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},A={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"11.847ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 5236.2 1000","aria-hidden":"true"},w={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},D={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.566ex"},xmlns:"http://www.w3.org/2000/svg",width:"19.986ex",height:"2.262ex",role:"img",focusable:"false",viewBox:"0 -750 8833.9 1000","aria-hidden":"true"},B={class:"MathJax",jax:"SVG",style:{direction:"ltr",position:"relative"}},v={style:{overflow:"visible","min-height":"1px","min-width":"1px","vertical-align":"-0.025ex"},xmlns:"http://www.w3.org/2000/svg",width:"1.179ex",height:"1.595ex",role:"img",focusable:"false",viewBox:"0 -694 521 705","aria-hidden":"true"},H={class:"jldocstring custom-block",open:""},j={class:"jldocstring custom-block",open:""},M={class:"jldocstring custom-block",open:""};function V(Z,i,z,P,S,I){const e=r("Badge");return h(),l("div",null,[i[63]||(i[63]=s("h1",{id:"Boltz.Layers-API-Reference",tabindex:"-1"},[s("code",null,"Boltz.Layers"),a(" API Reference "),s("a",{class:"header-anchor",href:"#Boltz.Layers-API-Reference","aria-label":'Permalink to "`Boltz.Layers` API Reference {#Boltz.Layers-API-Reference}"'},"")],-1)),i[64]||(i[64]=s("hr",null,null,-1)),s("details",d,[s("summary",null,[i[0]||(i[0]=s("a",{id:"Boltz.Layers.ClassTokens",href:"#Boltz.Layers.ClassTokens"},[s("span",{class:"jlbinding"},"Boltz.Layers.ClassTokens")],-1)),i[1]||(i[1]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[2]||(i[2]=t("",3))]),s("details",k,[s("summary",null,[i[3]||(i[3]=s("a",{id:"Boltz.Layers.ConvNormActivation",href:"#Boltz.Layers.ConvNormActivation"},[s("span",{class:"jlbinding"},"Boltz.Layers.ConvNormActivation")],-1)),i[4]||(i[4]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[5]||(i[5]=t("",7))]),s("details",T,[s("summary",null,[i[6]||(i[6]=s("a",{id:"Boltz.Layers.DynamicExpressionsLayer",href:"#Boltz.Layers.DynamicExpressionsLayer"},[s("span",{class:"jlbinding"},"Boltz.Layers.DynamicExpressionsLayer")],-1)),i[7]||(i[7]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[8]||(i[8]=t("",12))]),s("details",Q,[s("summary",null,[i[9]||(i[9]=s("a",{id:"Boltz.Layers.HamiltonianNN",href:"#Boltz.Layers.HamiltonianNN"},[s("span",{class:"jlbinding"},"Boltz.Layers.HamiltonianNN")],-1)),i[10]||(i[10]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[11]||(i[11]=t("",10))]),s("details",g,[s("summary",null,[i[12]||(i[12]=s("a",{id:"Boltz.Layers.MLP",href:"#Boltz.Layers.MLP"},[s("span",{class:"jlbinding"},"Boltz.Layers.MLP")],-1)),i[13]||(i[13]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[14]||(i[14]=t("",7))]),s("details",y,[s("summary",null,[i[15]||(i[15]=s("a",{id:"Boltz.Layers.MultiHeadSelfAttention",href:"#Boltz.Layers.MultiHeadSelfAttention"},[s("span",{class:"jlbinding"},"Boltz.Layers.MultiHeadSelfAttention")],-1)),i[16]||(i[16]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[17]||(i[17]=t("",5))]),s("details",m,[s("summary",null,[i[18]||(i[18]=s("a",{id:"Boltz.Layers.PatchEmbedding",href:"#Boltz.Layers.PatchEmbedding"},[s("span",{class:"jlbinding"},"Boltz.Layers.PatchEmbedding")],-1)),i[19]||(i[19]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[20]||(i[20]=t("",7))]),s("details",c,[s("summary",null,[i[21]||(i[21]=s("a",{id:"Boltz.Layers.PeriodicEmbedding",href:"#Boltz.Layers.PeriodicEmbedding"},[s("span",{class:"jlbinding"},"Boltz.Layers.PeriodicEmbedding")],-1)),i[22]||(i[22]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[23]||(i[23]=t("",12))]),s("details",E,[s("summary",null,[i[24]||(i[24]=s("a",{id:"Boltz.Layers.SplineLayer",href:"#Boltz.Layers.SplineLayer"},[s("span",{class:"jlbinding"},"Boltz.Layers.SplineLayer")],-1)),i[25]||(i[25]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[26]||(i[26]=t("",8))]),s("details",u,[s("summary",null,[i[27]||(i[27]=s("a",{id:"Boltz.Layers.TensorProductLayer",href:"#Boltz.Layers.TensorProductLayer"},[s("span",{class:"jlbinding"},"Boltz.Layers.TensorProductLayer")],-1)),i[28]||(i[28]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[51]||(i[51]=t("",1)),s("p",null,[i[31]||(i[31]=a("Constructs the Tensor Product Layer, which takes as input an array of n tensor product basis, ")),s("mjx-container",F,[(h(),l("svg",f,i[29]||(i[29]=[t("",1)]))),i[30]||(i[30]=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"["),s("msub",null,[s("mi",null,"B"),s("mn",null,"1")]),s("mo",null,","),s("msub",null,[s("mi",null,"B"),s("mn",null,"2")]),s("mo",null,","),s("mo",null,"…"),s("mo",null,","),s("msub",null,[s("mi",null,"B"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"]")])],-1))]),i[32]||(i[32]=a(" a data point x, computes"))]),s("mjx-container",b,[(h(),l("svg",C,i[33]||(i[33]=[t("",1)]))),i[34]||(i[34]=s("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("msub",null,[s("mi",null,"z"),s("mi",null,"i")]),s("mo",null,"="),s("msub",null,[s("mi",null,"W"),s("mrow",{"data-mjx-texclass":"ORD"},[s("mi",null,"i"),s("mo",null,","),s("mo",null,":")])]),s("mo",null,"⊙"),s("mo",{stretchy:"false"},"["),s("msub",null,[s("mi",null,"B"),s("mn",null,"1")]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"1")]),s("mo",{stretchy:"false"},")"),s("mo",null,"⊗"),s("msub",null,[s("mi",null,"B"),s("mn",null,"2")]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mn",null,"2")]),s("mo",{stretchy:"false"},")"),s("mo",null,"⊗"),s("mo",null,"⋯"),s("mo",null,"⊗"),s("msub",null,[s("mi",null,"B"),s("mi",null,"n")]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"x"),s("mi",null,"n")]),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"]")])],-1))]),s("p",null,[i[39]||(i[39]=a("where ")),s("mjx-container",_,[(h(),l("svg",L,i[35]||(i[35]=[s("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[s("g",{"data-mml-node":"math"},[s("g",{"data-mml-node":"mi"},[s("path",{"data-c":"1D44A",d:"M436 683Q450 683 486 682T553 680Q604 680 638 681T677 682Q695 682 695 674Q695 670 692 659Q687 641 683 639T661 637Q636 636 621 632T600 624T597 615Q597 603 613 377T629 138L631 141Q633 144 637 151T649 170T666 200T690 241T720 295T759 362Q863 546 877 572T892 604Q892 619 873 628T831 637Q817 637 817 647Q817 650 819 660Q823 676 825 679T839 682Q842 682 856 682T895 682T949 681Q1015 681 1034 683Q1048 683 1048 672Q1048 666 1045 655T1038 640T1028 637Q1006 637 988 631T958 617T939 600T927 584L923 578L754 282Q586 -14 585 -15Q579 -22 561 -22Q546 -22 542 -17Q539 -14 523 229T506 480L494 462Q472 425 366 239Q222 -13 220 -15T215 -19Q210 -22 197 -22Q178 -22 176 -15Q176 -12 154 304T131 622Q129 631 121 633T82 637H58Q51 644 51 648Q52 671 64 683H76Q118 680 176 680Q301 680 313 683H323Q329 677 329 674T327 656Q322 641 318 637H297Q236 634 232 620Q262 160 266 136L501 550L499 587Q496 629 489 632Q483 636 447 637Q428 637 422 639T416 648Q416 650 418 660Q419 664 420 669T421 676T424 680T428 682T436 683Z",style:{"stroke-width":"3"}})])])],-1)]))),i[36]||(i[36]=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"W")])],-1))]),i[40]||(i[40]=a(" is the layer's weight, and returns ")),s("mjx-container",x,[(h(),l("svg",A,i[37]||(i[37]=[t("",1)]))),i[38]||(i[38]=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"["),s("msub",null,[s("mi",null,"z"),s("mn",null,"1")]),s("mo",null,","),s("mo",null,"…"),s("mo",null,","),s("msub",null,[s("mi",null,"z"),s("mrow",{"data-mjx-texclass":"ORD"},[s("mi",null,"o"),s("mi",null,"u"),s("mi",null,"t")])]),s("mo",{stretchy:"false"},"]")])],-1))]),i[41]||(i[41]=a("."))]),i[52]||(i[52]=s("p",null,[s("strong",null,"Arguments")],-1)),s("ul",null,[s("li",null,[s("p",null,[i[46]||(i[46]=s("code",null,"basis_fns",-1)),i[47]||(i[47]=a(": Array of TensorProductBasis ")),s("mjx-container",w,[(h(),l("svg",D,i[42]||(i[42]=[t("",1)]))),i[43]||(i[43]=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mo",{stretchy:"false"},"["),s("msub",null,[s("mi",null,"B"),s("mn",null,"1")]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"n"),s("mn",null,"1")]),s("mo",{stretchy:"false"},")"),s("mo",null,","),s("mo",null,"…"),s("mo",null,","),s("msub",null,[s("mi",null,"B"),s("mi",null,"k")]),s("mo",{stretchy:"false"},"("),s("msub",null,[s("mi",null,"n"),s("mi",null,"k")]),s("mo",{stretchy:"false"},")"),s("mo",{stretchy:"false"},"]")])],-1))]),i[48]||(i[48]=a(", where ")),s("mjx-container",B,[(h(),l("svg",v,i[44]||(i[44]=[s("g",{stroke:"currentColor",fill:"currentColor","stroke-width":"0",transform:"scale(1,-1)"},[s("g",{"data-mml-node":"math"},[s("g",{"data-mml-node":"mi"},[s("path",{"data-c":"1D458",d:"M121 647Q121 657 125 670T137 683Q138 683 209 688T282 694Q294 694 294 686Q294 679 244 477Q194 279 194 272Q213 282 223 291Q247 309 292 354T362 415Q402 442 438 442Q468 442 485 423T503 369Q503 344 496 327T477 302T456 291T438 288Q418 288 406 299T394 328Q394 353 410 369T442 390L458 393Q446 405 434 405H430Q398 402 367 380T294 316T228 255Q230 254 243 252T267 246T293 238T320 224T342 206T359 180T365 147Q365 130 360 106T354 66Q354 26 381 26Q429 26 459 145Q461 153 479 153H483Q499 153 499 144Q499 139 496 130Q455 -11 378 -11Q333 -11 305 15T277 90Q277 108 280 121T283 145Q283 167 269 183T234 206T200 217T182 220H180Q168 178 159 139T145 81T136 44T129 20T122 7T111 -2Q98 -11 83 -11Q66 -11 57 -1T48 16Q48 26 85 176T158 471L195 616Q196 629 188 632T149 637H144Q134 637 131 637T124 640T121 647Z",style:{"stroke-width":"3"}})])])],-1)]))),i[45]||(i[45]=s("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[s("mi",null,"k")])],-1))]),i[49]||(i[49]=a(" corresponds to the dimension of the input."))])]),i[50]||(i[50]=s("li",null,[s("p",null,[s("code",null,"out_dim"),a(": Dimension of the output.")])],-1))]),i[53]||(i[53]=t("",4))]),s("details",H,[s("summary",null,[i[54]||(i[54]=s("a",{id:"Boltz.Layers.ViPosEmbedding",href:"#Boltz.Layers.ViPosEmbedding"},[s("span",{class:"jlbinding"},"Boltz.Layers.ViPosEmbedding")],-1)),i[55]||(i[55]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[56]||(i[56]=t("",3))]),s("details",j,[s("summary",null,[i[57]||(i[57]=s("a",{id:"Boltz.Layers.VisionTransformerEncoder",href:"#Boltz.Layers.VisionTransformerEncoder"},[s("span",{class:"jlbinding"},"Boltz.Layers.VisionTransformerEncoder")],-1)),i[58]||(i[58]=a()),n(e,{type:"info",class:"jlObjectType jlType",text:"Type"})]),i[59]||(i[59]=t("",7))]),s("details",M,[s("summary",null,[i[60]||(i[60]=s("a",{id:"Boltz.Layers.ConvBatchNormActivation-Union{Tuple{F}, Tuple{NTuple{N, Int64} where N, Pair{Int64, Int64}, Int64, F}} where F",href:"#Boltz.Layers.ConvBatchNormActivation-Union{Tuple{F}, Tuple{NTuple{N, Int64} where N, Pair{Int64, Int64}, Int64, F}} where F"},[s("span",{class:"jlbinding"},"Boltz.Layers.ConvBatchNormActivation")],-1)),i[61]||(i[61]=a()),n(e,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),i[62]||(i[62]=t("",3))]),i[65]||(i[65]=t("",3))])}const O=p(o,[["render",V]]);export{R as __pageData,O as default};
diff --git a/previews/PR98/assets/api_private.md.BJWD8BVj.js b/previews/PR98/assets/api_private.md.BJWD8BVj.js
new file mode 100644
index 0000000..947b91a
--- /dev/null
+++ b/previews/PR98/assets/api_private.md.BJWD8BVj.js
@@ -0,0 +1 @@
+import{_ as n,c as o,j as t,a as e,G as i,a2 as l,B as p,o as r}from"./chunks/framework.BI0fNMXE.js";const j=JSON.parse('{"title":"Private API","description":"","frontmatter":{},"headers":[],"relativePath":"api/private.md","filePath":"api/private.md","lastUpdated":null}'),d={name:"api/private.md"},h={class:"jldocstring custom-block",open:""},u={class:"jldocstring custom-block",open:""},k={class:"jldocstring custom-block",open:""},c={class:"jldocstring custom-block",open:""};function b(_,s,g,f,y,T){const a=p("Badge");return r(),o("div",null,[s[12]||(s[12]=t("h1",{id:"Private-API",tabindex:"-1"},[e("Private API "),t("a",{class:"header-anchor",href:"#Private-API","aria-label":'Permalink to "Private API {#Private-API}"'},"")],-1)),s[13]||(s[13]=t("p",null,"This is the private API reference for Boltz.jl. You know what this means. Don't use these functions!",-1)),t("details",h,[t("summary",null,[s[0]||(s[0]=t("a",{id:"Boltz.Utils.fast_chunk-Tuple{Int64, Int64}",href:"#Boltz.Utils.fast_chunk-Tuple{Int64, Int64}"},[t("span",{class:"jlbinding"},"Boltz.Utils.fast_chunk")],-1)),s[1]||(s[1]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[2]||(s[2]=l('
',3))]),t("details",u,[t("summary",null,[s[3]||(s[3]=t("a",{id:"Boltz.Utils.flatten_spatial-Union{Tuple{AbstractArray{T, 4}}, Tuple{T}} where T",href:"#Boltz.Utils.flatten_spatial-Union{Tuple{AbstractArray{T, 4}}, Tuple{T}} where T"},[t("span",{class:"jlbinding"},"Boltz.Utils.flatten_spatial")],-1)),s[4]||(s[4]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[5]||(s[5]=l('
julia
flatten_spatial(x::AbstractArray{T, 4})
Flattens the first 2 dimensions of x, and permutes the remaining dimensions to (2, 1, 3).
',3))]),t("details",c,[t("summary",null,[s[9]||(s[9]=t("a",{id:"Boltz.Utils.should_type_assert-Union{Tuple{AbstractArray{T}}, Tuple{T}} where T",href:"#Boltz.Utils.should_type_assert-Union{Tuple{AbstractArray{T}}, Tuple{T}} where T"},[t("span",{class:"jlbinding"},"Boltz.Utils.should_type_assert")],-1)),s[10]||(s[10]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[11]||(s[11]=l('
julia
should_type_assert(x)
In certain cases, to ensure type-stability we want to add type-asserts. But this won't work for exotic types like ForwardDiff.Dual. We use this function to check if we should add a type-assert for x.
',3))])])}const A=n(d,[["render",b]]);export{j as __pageData,A as default};
diff --git a/previews/PR98/assets/api_private.md.BJWD8BVj.lean.js b/previews/PR98/assets/api_private.md.BJWD8BVj.lean.js
new file mode 100644
index 0000000..76c0fd4
--- /dev/null
+++ b/previews/PR98/assets/api_private.md.BJWD8BVj.lean.js
@@ -0,0 +1 @@
+import{_ as n,c as o,j as t,a as e,G as i,a2 as l,B as p,o as r}from"./chunks/framework.BI0fNMXE.js";const j=JSON.parse('{"title":"Private API","description":"","frontmatter":{},"headers":[],"relativePath":"api/private.md","filePath":"api/private.md","lastUpdated":null}'),d={name:"api/private.md"},h={class:"jldocstring custom-block",open:""},u={class:"jldocstring custom-block",open:""},k={class:"jldocstring custom-block",open:""},c={class:"jldocstring custom-block",open:""};function b(_,s,g,f,y,T){const a=p("Badge");return r(),o("div",null,[s[12]||(s[12]=t("h1",{id:"Private-API",tabindex:"-1"},[e("Private API "),t("a",{class:"header-anchor",href:"#Private-API","aria-label":'Permalink to "Private API {#Private-API}"'},"")],-1)),s[13]||(s[13]=t("p",null,"This is the private API reference for Boltz.jl. You know what this means. Don't use these functions!",-1)),t("details",h,[t("summary",null,[s[0]||(s[0]=t("a",{id:"Boltz.Utils.fast_chunk-Tuple{Int64, Int64}",href:"#Boltz.Utils.fast_chunk-Tuple{Int64, Int64}"},[t("span",{class:"jlbinding"},"Boltz.Utils.fast_chunk")],-1)),s[1]||(s[1]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[2]||(s[2]=l("",3))]),t("details",u,[t("summary",null,[s[3]||(s[3]=t("a",{id:"Boltz.Utils.flatten_spatial-Union{Tuple{AbstractArray{T, 4}}, Tuple{T}} where T",href:"#Boltz.Utils.flatten_spatial-Union{Tuple{AbstractArray{T, 4}}, Tuple{T}} where T"},[t("span",{class:"jlbinding"},"Boltz.Utils.flatten_spatial")],-1)),s[4]||(s[4]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[5]||(s[5]=l("",3))]),t("details",k,[t("summary",null,[s[6]||(s[6]=t("a",{id:"Boltz.Utils.second_dim_mean-Tuple{Any}",href:"#Boltz.Utils.second_dim_mean-Tuple{Any}"},[t("span",{class:"jlbinding"},"Boltz.Utils.second_dim_mean")],-1)),s[7]||(s[7]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[8]||(s[8]=l("",3))]),t("details",c,[t("summary",null,[s[9]||(s[9]=t("a",{id:"Boltz.Utils.should_type_assert-Union{Tuple{AbstractArray{T}}, Tuple{T}} where T",href:"#Boltz.Utils.should_type_assert-Union{Tuple{AbstractArray{T}}, Tuple{T}} where T"},[t("span",{class:"jlbinding"},"Boltz.Utils.should_type_assert")],-1)),s[10]||(s[10]=e()),i(a,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),s[11]||(s[11]=l("",3))])])}const A=n(d,[["render",b]]);export{j as __pageData,A as default};
diff --git a/previews/PR98/assets/api_vision.md.B5rI8T8X.js b/previews/PR98/assets/api_vision.md.B5rI8T8X.js
new file mode 100644
index 0000000..56aa70b
--- /dev/null
+++ b/previews/PR98/assets/api_vision.md.B5rI8T8X.js
@@ -0,0 +1 @@
+import{_ as n,c as o,j as t,a as i,G as l,a2 as s,B as d,o as r}from"./chunks/framework.BI0fNMXE.js";const T=JSON.parse('{"title":"Computer Vision Models (Vision API)","description":"","frontmatter":{},"headers":[],"relativePath":"api/vision.md","filePath":"api/vision.md","lastUpdated":null}'),p={name:"api/vision.md"},h={class:"jldocstring custom-block",open:""},c={class:"jldocstring custom-block",open:""},g={class:"jldocstring custom-block",open:""},k={class:"jldocstring custom-block",open:""},u={class:"jldocstring custom-block",open:""},y={class:"jldocstring custom-block",open:""},m={class:"jldocstring custom-block",open:""},b={class:"jldocstring custom-block",open:""},f={class:"jldocstring custom-block",open:""},C={class:"jldocstring custom-block",open:""},v={class:"jldocstring custom-block",open:""};function E(x,e,F,B,_,j){const a=d("Badge");return r(),o("div",null,[e[33]||(e[33]=t("h1",{id:"Computer-Vision-Models-(Vision-API)",tabindex:"-1"},[i("Computer Vision Models ("),t("code",null,"Vision"),i(" API) "),t("a",{class:"header-anchor",href:"#Computer-Vision-Models-(Vision-API)","aria-label":'Permalink to "Computer Vision Models (`Vision` API) {#Computer-Vision-Models-(Vision-API)}"'},"")],-1)),e[34]||(e[34]=t("h2",{id:"Native-Lux-Models",tabindex:"-1"},[i("Native Lux Models "),t("a",{class:"header-anchor",href:"#Native-Lux-Models","aria-label":'Permalink to "Native Lux Models {#Native-Lux-Models}"'},"")],-1)),t("details",h,[t("summary",null,[e[0]||(e[0]=t("a",{id:"Boltz.Vision.AlexNet",href:"#Boltz.Vision.AlexNet"},[t("span",{class:"jlbinding"},"Boltz.Vision.AlexNet")],-1)),e[1]||(e[1]=i()),l(a,{type:"info",class:"jlObjectType jlType",text:"Type"})]),e[2]||(e[2]=s('
Creates a Vision Transformer model with the specified configuration.
Arguments
name::Symbol: name of the Vision Transformer model to create. The following models are available – :tiny, :small, :base, :large, :huge, :giant, :gigantic.
Keyword Arguments
pretrained::Bool=false: If true, loads pretrained weights when LuxCore.setup is called.
',7))]),e[35]||(e[35]=t("h2",{id:"Imported-from-Metalhead.jl",tabindex:"-1"},[i("Imported from Metalhead.jl "),t("a",{class:"header-anchor",href:"#Imported-from-Metalhead.jl","aria-label":'Permalink to "Imported from Metalhead.jl {#Imported-from-Metalhead.jl}"'},"")],-1)),e[36]||(e[36]=t("div",{class:"tip custom-block"},[t("p",{class:"custom-block-title"},"Load Metalhead"),t("p",null,[i("You need to load "),t("code",null,"Metalhead"),i(" before using these models.")])],-1)),t("details",k,[t("summary",null,[e[9]||(e[9]=t("a",{id:"Boltz.Vision.ConvMixer",href:"#Boltz.Vision.ConvMixer"},[t("span",{class:"jlbinding"},"Boltz.Vision.ConvMixer")],-1)),e[10]||(e[10]=i()),l(a,{type:"info",class:"jlObjectType jlFunction",text:"Function"})]),e[11]||(e[11]=s('
You need to load JLD2 before being able to load pretrained weights.
Load Pretrained Weights
Pass pretrained=true to the model constructor to load the pretrained weights.
MODEL
TOP 1 ACCURACY (%)
TOP 5 ACCURACY (%)
AlexNet()
54.48
77.72
VGG(11)
67.35
87.91
VGG(13)
68.40
88.48
VGG(16)
70.24
89.80
VGG(19)
71.09
90.27
VGG(11; batchnorm=true)
69.09
88.94
VGG(13; batchnorm=true)
69.66
89.49
VGG(16; batchnorm=true)
72.11
91.02
VGG(19; batchnorm=true)
72.95
91.32
ResNet(18)
-
-
ResNet(34)
-
-
ResNet(50)
-
-
ResNet(101)
-
-
ResNet(152)
-
-
ResNeXt(50; cardinality=32, base_width=4)
-
-
ResNeXt(101; cardinality=32, base_width=8)
-
-
ResNeXt(101; cardinality=64, base_width=4)
-
-
SqueezeNet()
-
-
WideResNet(50)
-
-
WideResNet(101)
-
-
Pretrained Models from Metalhead
For Models imported from Metalhead, the pretrained weights can be loaded if they are available in Metalhead. Refer to the Metalhead.jl docs for a list of available pretrained models.
All the pretrained models require that the images be normalized with the parameters mean = [0.485f0, 0.456f0, 0.406f0] and std = [0.229f0, 0.224f0, 0.225f0].
He, K.; Zhang, X.; Ren, S. and Sun, J. (2016). Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 770–778.
Howard, A.; Sandler, M.; Chu, G.; Chen, L.-C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V. and others (2019). Searching for mobilenetv3. In: Proceedings of the IEEE/CVF international conference on computer vision; pp. 1314–1324.
Howard, A. G. (2017). MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications, arXiv preprint arXiv:1704.04861.
Huang, G.; Liu, Z.; Van Der Maaten, L. and Weinberger, K. Q. (2017). Densely connected convolutional networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 4700–4708.
Krizhevsky, A.; Sutskever, I. and Hinton, G. E. (2012). Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25.
Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A. and Chen, L.-C. (2018). Mobilenetv2: Inverted residuals and linear bottlenecks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 4510–4520.
Simonyan, K. (2014). Very deep convolutional networks for large-scale image recognition, arXiv preprint arXiv:1409.1556.
Szegedy, C.; Liu, W.; Jia, Y.; Sermanet, P.; Reed, S.; Anguelov, D.; Erhan, D.; Vanhoucke, V. and Rabinovich, A. (2015). Going deeper with convolutions. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 1–9.
Trockman, A. and Kolter, J. Z. (2022). Patches are all you need? arXiv preprint arXiv:2201.09792.
Xie, S.; Girshick, R.; Dollár, P.; Tu, Z. and He, K. (2017). Aggregated residual transformations for deep neural networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition; pp. 1492–1500.
',3))}const jo=$(Oo,[["render",Uo]]),Go=a=>{if(typeof document>"u")return{stabilizeScrollPosition:n=>async(...i)=>n(...i)};const e=document.documentElement;return{stabilizeScrollPosition:s=>async(...n)=>{const i=s(...n),l=a.value;if(!l)return i;const d=l.offsetTop-e.scrollTop;return await he(),e.scrollTop=l.offsetTop-d,i}}},Oe="vitepress:tabSharedState",J=typeof localStorage<"u"?localStorage:null,Ue="vitepress:tabsSharedState",zo=()=>{const a=J==null?void 0:J.getItem(Ue);if(a)try{return JSON.parse(a)}catch{}return{}},Ko=a=>{J&&J.setItem(Ue,JSON.stringify(a))},Ro=a=>{const e=nt({});D(()=>e.content,(t,s)=>{t&&s&&Ko(t)},{deep:!0}),a.provide(Oe,e)},Wo=(a,e)=>{const t=q(Oe);if(!t)throw new Error("[vitepress-plugin-tabs] TabsSharedState should be injected");O(()=>{t.content||(t.content=zo())});const s=T(),n=y({get(){var f;const l=e.value,d=a.value;if(l){const b=(f=t.content)==null?void 0:f[l];if(b&&d.includes(b))return b}else{const b=s.value;if(b)return b}return d[0]},set(l){const d=e.value;d?t.content&&(t.content[d]=l):s.value=l}});return{selected:n,select:l=>{n.value=l}}};let Ve=0;const qo=()=>(Ve++,""+Ve);function Jo(){const a=Ae();return y(()=>{var s;const t=(s=a.default)==null?void 0:s.call(a);return t?t.filter(n=>typeof n.type=="object"&&"__name"in n.type&&n.type.__name==="PluginTabsTab"&&n.props).map(n=>{var i;return(i=n.props)==null?void 0:i.label}):[]})}const je="vitepress:tabSingleState",Yo=a=>{me(je,a)},Xo=()=>{const a=q(je);if(!a)throw new Error("[vitepress-plugin-tabs] TabsSingleState should be injected");return a},Qo={class:"plugin-tabs"},Zo=["id","aria-selected","aria-controls","tabindex","onClick"],xo=m({__name:"PluginTabs",props:{sharedStateKey:{}},setup(a){const e=a,t=Jo(),{selected:s,select:n}=Wo(t,st(e,"sharedStateKey")),i=T(),{stabilizeScrollPosition:l}=Go(i),d=l(n),f=T([]),b=_=>{var A;const P=t.value.indexOf(s.value);let S;_.key==="ArrowLeft"?S=P>=1?P-1:t.value.length-1:_.key==="ArrowRight"&&(S=P(o(),c("div",Qo,[p("div",{ref_key:"tablist",ref:i,class:"plugin-tabs--tab-list",role:"tablist",onKeydown:b},[(o(!0),c(M,null,H(r(t),S=>(o(),c("button",{id:`tab-${S}-${r(L)}`,ref_for:!0,ref_key:"buttonRefs",ref:f,key:S,role:"tab",class:"plugin-tabs--tab","aria-selected":S===r(s),"aria-controls":`panel-${S}-${r(L)}`,tabindex:S===r(s)?0:-1,onClick:()=>r(d)(S)},w(S),9,Zo))),128))],544),u(_.$slots,"default")]))}}),er=["id","aria-labelledby"],tr=m({__name:"PluginTabsTab",props:{label:{}},setup(a){const{uid:e,selected:t}=Xo();return(s,n)=>r(t)===s.label?(o(),c("div",{key:0,id:`panel-${s.label}-${r(e)}`,class:"plugin-tabs--content",role:"tabpanel",tabindex:"0","aria-labelledby":`tab-${s.label}-${r(e)}`},[u(s.$slots,"default",{},void 0,!0)],8,er)):h("",!0)}}),nr=$(tr,[["__scopeId","data-v-9b0d03d2"]]),sr=a=>{Ro(a),a.component("PluginTabs",xo),a.component("PluginTabsTab",nr)},or={extends:Le,Layout(){return Pe(Le.Layout,null,{"aside-ads-before":()=>Pe(jo)})},enhanceApp({app:a}){sr(a)}};export{or as R,ga as c,V as u};
diff --git a/previews/PR98/assets/index.md.ac-RXHi6.js b/previews/PR98/assets/index.md.ac-RXHi6.js
new file mode 100644
index 0000000..4f4ae5e
--- /dev/null
+++ b/previews/PR98/assets/index.md.ac-RXHi6.js
@@ -0,0 +1,9 @@
+import{_ as s,c as a,a2 as t,o as l}from"./chunks/framework.BI0fNMXE.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{"layout":"home","hero":{"name":"Boltz.jl ⚡ Docs","text":"Pre-built Deep Learning Models in Julia","tagline":"Accelerate ⚡ your ML research using pre-built Deep Learning Models with Lux","actions":[{"theme":"brand","text":"Lux.jl Docs","link":"https://lux.csail.mit.edu/"},{"theme":"alt","text":"Tutorials 📚","link":"/tutorials/1_GettingStarted"},{"theme":"alt","text":"Vision Models 👀","link":"/api/vision"},{"theme":"alt","text":"Layers API 🧩","link":"/api/layers"},{"theme":"alt","text":"View on GitHub","link":"https://github.com/LuxDL/Boltz.jl"}],"image":{"src":"/lux-logo.svg","alt":"Lux.jl"}},"features":[{"icon":"🔥","title":"Powered by Lux.jl","details":"Boltz.jl is built on top of Lux.jl, a pure Julia Deep Learning Framework designed for Scientific Machine Learning.","link":"https://lux.csail.mit.edu/"},{"icon":"🧩","title":"Pre-built Models","details":"Boltz.jl provides pre-built models for common deep learning tasks, such as image classification.","link":"/api/vision"},{"icon":"🧑🔬","title":"SciML Primitives","details":"Common deep learning primitives needed for scientific machine learning.","link":"https://sciml.ai/"}]},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":null}'),e={name:"index.md"};function n(h,i,p,k,d,o){return l(),a("div",null,i[0]||(i[0]=[t(`
Its easy to install Boltz.jl. Since Boltz.jl is registered in the Julia General registry, you can simply run the following command in the Julia REPL:
julia
julia> using Pkg
+julia> Pkg.add("Boltz")
If you want to use the latest unreleased version of Boltz.jl, you can run the following command: (in most cases the released version will be same as the version on github)
julia
julia> using Pkg
+julia> Pkg.add(url="https://github.com/LuxDL/Boltz.jl")
The MLP function is just a convenience wrapper around Lux.Chain that constructs a multi-layer perceptron with the given number of layers and activation function.
Let's setup the neural network. For the first part, we won't do any symbolic regression. We will plain and simple train a neural network to solve the optimal control problem.
Ok so now we have a trained neural network that solves the optimal control problem. But can we replace Dense(4 => 4, gelu) with a symbolic expression? Let's try!
One important note here is to transpose the data because that is how MLJ expects the data to be structured (this is in contrast to how Lux or SymbolicRegression expects the data)
Let's see the expressions that SymbolicRegression.jl found. In case you were wondering, these expressions are not hardcoded, it is live updated from the output of the code above using Latexify.jl and the integration of SymbolicUtils.jl with DynamicExpressions.jl.
Combining the Neural Network with the Symbolic Expression
Now that we have the symbolic expression, we can combine it with the neural network to solve the optimal control problem. but we do need to perform some finetuning.
There you have it! It is that easy to take the fitted Symbolic Expression and combine it with a neural network. Let's see how it performs before fintetuning.
Now that does perform well! But we could finetune this model very easily. We will skip that part on CI, but you can do it by using the same training code as above.
Its easy to install Boltz.jl. Since Boltz.jl is registered in the Julia General registry, you can simply run the following command in the Julia REPL:
julia
julia> using Pkg
+julia> Pkg.add("Boltz")
If you want to use the latest unreleased version of Boltz.jl, you can run the following command: (in most cases the released version will be same as the version on github)
julia
julia> using Pkg
+julia> Pkg.add(url="https://github.com/LuxDL/Boltz.jl")
The MLP function is just a convenience wrapper around Lux.Chain that constructs a multi-layer perceptron with the given number of layers and activation function.
Here we will solve a classic optimal control problem with a universal differential equation. Let
where we want to optimize our controller such that the following is minimized:
where is measured on at intervals. To do this, we rewrite the ODE in first order form:
and thus
is our loss function on the first order system. We thus choose a neural network form for and optimize the equation with respect to this loss. Note that we will first reduce control cost (the last term) by 10x in order to bump the network out of a local minimum. This looks like:
Let's setup the neural network. For the first part, we won't do any symbolic regression. We will plain and simple train a neural network to solve the optimal control problem.
Ok so now we have a trained neural network that solves the optimal control problem. But can we replace Dense(4 => 4, gelu) with a symbolic expression? Let's try!
One important note here is to transpose the data because that is how MLJ expects the data to be structured (this is in contrast to how Lux or SymbolicRegression expects the data)
Let's see the expressions that SymbolicRegression.jl found. In case you were wondering, these expressions are not hardcoded, it is live updated from the output of the code above using Latexify.jl and the integration of SymbolicUtils.jl with DynamicExpressions.jl.
Combining the Neural Network with the Symbolic Expression
Now that we have the symbolic expression, we can combine it with the neural network to solve the optimal control problem. but we do need to perform some finetuning.
There you have it! It is that easy to take the fitted Symbolic Expression and combine it with a neural network. Let's see how it performs before fintetuning.
Now that does perform well! But we could finetune this model very easily. We will skip that part on CI, but you can do it by using the same training code as above.