merlin.torch_utils package
- class merlin.torch_utils.FeatureEncoder(feature_count)
Bases:
object
Utility class for encoding classical features into quantum circuit parameters.
This class provides methods to encode normalized classical features into parameters that can be used to configure quantum circuits. Different encoding strategies are supported depending on the circuit type.
- encode(X_norm, circuit_type, n_modes, bandwidth_coeffs=None, total_shifters=None)
Encode normalized features into quantum circuit parameters.
- Return type:
Tensor
- Args:
X_norm: Normalized input features of shape (batch_size, num_features) circuit_type: Type of quantum circuit architecture n_modes: Number of modes in the quantum circuit bandwidth_coeffs: Optional bandwidth tuning coefficients for each feature dimension total_shifters: Optional total number of phase shifters (unused in current implementation)
- Returns:
Encoded parameters tensor of shape (batch_size, num_parameters)
- Raises:
ValueError: If circuit_type is not supported