prevision_quantum_nn

prevision_quantum_nn module

Subpackages

Package Contents

Functions

get_model(params) Get a model according to parameters.
get_application(application_type, prefix=’qnn’, preprocessing_params=None, model_params=None, postprocessing_params=None, rl_learner_type=’quantum’) Get application.
load_application(application_params, model_weights, preprocessor_file) loads application from files
get_dataset_from_numpy(train_features, train_labels, val_features=None, val_labels=None) get dataset from numpy
get_dataset_from_pandas(train_data_frame, targets, val_data_frame=None) get dataset from pandas
parse_results(results_file) Parse a result file in order to extract parameters.
plot_losses(results, prefix=’qnn’) Plot the losses of an application.
plot_metric(results, prefix=’qnn’) Plot the relevant metric of an application.
plot_reward(results, prefix=’qnn’) Plot the reward of a RL application.
prevision_quantum_nn.__version__ = 1.0.1
prevision_quantum_nn.get_model(params)

Get a model according to parameters.

Parameters:params (dictionnary) – parameters of the model
Returns:
QuantumNeuralNetwork
model to be constructed with these parameters
Return type:model
prevision_quantum_nn.get_application(application_type, prefix='qnn', preprocessing_params=None, model_params=None, postprocessing_params=None, rl_learner_type='quantum')

Get application.

Parameters:application_type (str) – application type can be 1. classification 2. multiclassification 3. regression 4. reinforcement_learning
Returns:
Application
application according to application type
Return type:application
prevision_quantum_nn.load_application(application_params, model_weights, preprocessor_file)

loads application from files

prevision_quantum_nn.get_dataset_from_numpy(train_features, train_labels, val_features=None, val_labels=None)

get dataset from numpy

prevision_quantum_nn.get_dataset_from_pandas(train_data_frame, targets, val_data_frame=None)

get dataset from pandas

prevision_quantum_nn.parse_results(results_file)

Parse a result file in order to extract parameters.

Parameters:results_file (string) – path to a log file of an application
Returns:
Pandas dataframe
dataframe containing parameters to be plotted.
Return type:results
prevision_quantum_nn.plot_losses(results, prefix='qnn')

Plot the losses of an application.

Parameters:
  • results (Pandas dataframe) – dataframe containing the losses
  • prefix (string) – part of the name given to the generated plot
prevision_quantum_nn.plot_metric(results, prefix='qnn')

Plot the relevant metric of an application.

Parameters:
  • results (Pandas dataframe) – dataframe containing the metrics
  • prefix (string) – part of the name given to the generated plot
prevision_quantum_nn.plot_reward(results, prefix='qnn')

Plot the reward of a RL application.

Parameters:
  • results (Pandas dataframe) – dataframe containing the rewards
  • prefix (string) – part of the name given to the generated plot