kosmos.ml.config.factories.model¶
Classes¶
- class NeuralNetworkConfig(hidden_layers: list[int])¶
Bases:
ModelConfigNeural network configuration.
Initialize the neural network configuration.
- Parameters:
hidden_layers (list[int]) – Sizes of the hidden layers. The length of the list defines the number of hidden layers, and each element specifies the size of a layer.
Methods
- get_instance(input_dim: int, output_dim: int) kosmos.ml.models.neural_network.NeuralNetwork¶
Get the neural network instance.
- Parameters:
- Returns:
Neural network instance.
- Return type:
- class VQCConfig(num_layers: int, encoding_config: kosmos.ml.config.factories.encoding.EncodingConfig, weight_mapping_func: kosmos.ml.typing.TensorMapping | None = None, input_mapping_func: kosmos.ml.typing.TensorMapping | None = None, weight_init_range: tuple[float, float] = (-1.0, 1.0), bias_init_range: tuple[float, float] | None = (-0.001, 0.001), *, data_reuploading: bool = False, output_scaling: bool = False)¶
Bases:
ModelConfigVariational quantum circuit configuration.
Initialize the VQC configuration.
- Parameters:
num_layers (int) – The number of variational layers.
encoding_config (EncodingConfig) – The encoding configuration.
weight_mapping_func (TensorMapping | None) – The mapping function for the weights. Defaults to None.
input_mapping_func (TensorMapping | None) – The mapping function for the input. Defaults to None.
weight_init_range (tuple[float, float]) – Lower and upper bounds for initializing the trainable weight parameters. Defaults to (-1.0, 1.0).
bias_init_range (tuple[float, float] | None) – Lower and upper bounds for initializing the trainable bias parameters applied to each output unit. If None, no bias parameters are used. Defaults to (-0.001, 0.001).
data_reuploading (bool) – Whether to use data re-uploading. Defaults to False.
output_scaling (bool) – Whether to use output scaling. Defaults to False.
Methods