# nn


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L262"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_property_predictor

``` python
def make_property_predictor(
    key, d:int=512, ldmin:float=0.0031622776601683794, ldmax:float=1995.2623149688789, hidden_layer:int=512,
    ffdim:int=512, nhead:int=32, nlayers:int=6, dout:int=10, act_fn:jax._src.custom_derivatives.custom_jvp=relu,
    initializer:function=he_normal, attention_backend:NoneType=None, block_size:int=128, bias:bool=True,
    mask_fn:function=mask_fn
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L237"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_spectrum_encoder

``` python
def make_spectrum_encoder(
    key, d:int=512, ldmin:float=0.0031622776601683794, ldmax:float=1995.2623149688789, hidden_layer:int=512,
    ffdim:int=512, nhead:int=32, nlayers:int=6, act_fn:jax._src.custom_derivatives.custom_jvp=relu,
    initializer:function=he_normal, attention_backend:NoneType=None, block_size:int=128, mask_fn:function=mask_fn
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L220"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_transformer_block

``` python
def make_transformer_block(
    key, nembd, nhead, ffdim:NoneType=None, attention_backend:NoneType=None, block_size:int=128,
    act_fn:jax._src.custom_derivatives.custom_jvp=relu, initializer:function=he_normal, bias:bool=True
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L170"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_multi_head_attention

``` python
def make_multi_head_attention(
    key, nembd, nhead, attention_backend:NoneType=None, block_size:int=128, initializer:function=he_normal
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L135"
target="_blank" style="float:right; font-size:smaller">source</a>

### blockwise_attention

``` python
def blockwise_attention(
    q, k, v, mask:NoneType=None, block_size:int=128
):
```

*q: (B, N, T, H), k: (B, N, T, H), v: (B, N, T, H)*

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L133"
target="_blank" style="float:right; font-size:smaller">source</a>

### mask_fn

``` python
def mask_fn(
    x
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L113"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_peak_embedding

``` python
def make_peak_embedding(
    key, d:int=512, hidden_layer:int=512, ldmin:float=0.0031622776601683794, ldmax:float=1995.2623149688789,
    act_fn:jax._src.custom_derivatives.custom_jvp=relu, initializer:function=he_normal, bias:bool=True
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L101"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_sinusoidal_embedding

``` python
def make_sinusoidal_embedding(
    d:int=512, ldmin:float=0.0031622776601683794, ldmax:float=1995.2623149688789
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L84"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_layernorm2d

``` python
def make_layernorm2d(
    key, num_features, eps:float=1e-05, offset:bool=True, ndims:int=4
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L69"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_layernorm1d

``` python
def make_layernorm1d(
    key, num_features, eps:float=1e-05, offset:bool=True
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L60"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_squeeze

``` python
def make_squeeze(
    key, dims:NoneType=None
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L46"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_conv2d

``` python
def make_conv2d(
    key, cho, chi, ks:tuple=(3, 3), padding:str='SAME', strides:tuple=(1, 1),
    act_fn:jax._src.custom_derivatives.custom_jvp=relu, initializer:function=he_normal, bias:bool=True,
    act:bool=True
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L34"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_ffn

``` python
def make_ffn(
    key, din, dout, hidden_layer:int=512, act_fn:jax._src.custom_derivatives.custom_jvp=relu,
    initializer:function=he_normal, bias:bool=True
):
```

------------------------------------------------------------------------

<a
href="https://github.com/frenio/lucidlearn/blob/main/lucidlearn/nn.py#L20"
target="_blank" style="float:right; font-size:smaller">source</a>

### make_linear

``` python
def make_linear(
    key, fan_in, fan_out, act_fn:jax._src.custom_derivatives.custom_jvp=relu, initializer:function=he_normal,
    bias:bool=True, act:bool=True
):
```
