sop.OneBody
sop.OneBody(
self
input_size
hidden_size
basis_size
output_size=1
w_scale=1.0
b_scale=1.0
w_dist='uniform'
b_dist='linspace'
x0=None
activation='moderate+silu'
key=None
X_out=None
fix_bias=False
)
Function given by sum of one-body functions
\[ f(q_1, q_2, \ldots, q_f) = \sum_{p=1}^{f} \sum_{\rho_p} W_{\rho_p}^{(p)} \phi_{\rho_p}(w_{\rho_p}^{(p)} q_p+b_{\rho_p}^{(p)}) \]
Attributes
Name | Description |
---|---|
q0 | Get initial hidden coordinates \(q_0=x_0U\) |
Methods
Name | Description |
---|---|
export_h5 | Export the model to a HDF5 file |
import_h5 | Import the model from a HDF5 file |
mse | Mean squared error |
mse_force | Mean squared error with force |
plot_basis | Plot distribution of \(\phi\) |
show_onebody | Visualize one-dimensional cut. |
to_nnmpo | Convert to NNMPO model |
export_h5
Export the model to a HDF5 file
Parameters
Name | Type | Description | Default |
---|---|---|---|
path | str | path to the HDF5 file | required |
Examples
See Also
import_h5
Import the model from a HDF5 file
Parameters
Name | Type | Description | Default |
---|---|---|---|
path | str | path to the HDF5 file | required |
Returns
Name | Type | Description |
---|---|---|
Model | Model | model instance |
Examples
See Also
mse
Mean squared error
Parameters
Name | Type | Description | Default |
---|---|---|---|
x | Array | input tensor with shape \((D,n)\) where \(D\) is the batch size and \(n\) is the input size. | required |
y | Array | output tensor with shape \((D,1)\) | required |
Returns
Name | Type | Description |
---|---|---|
float | float | mean squared error |
mse_force
Mean squared error with force
Parameters
Name | Type | Description | Default |
---|---|---|---|
x | Array | input tensor with shape \((D,n)\) where \(D\) is the batch size and \(n\) is the input size. | required |
f | Array | force tensor with shape \((D,n)\) | required |
plot_basis
Plot distribution of \(\phi\)
Parameters
Name | Type | Description | Default |
---|---|---|---|
x | Array | input tensor with shape \((D,n)\) where \(D\) is the batch size and \(n\) is the input size. | required |
Examples
show_onebody
Visualize one-dimensional cut.
Examples
to_nnmpo
Convert to NNMPO model