# Correlated Noise¶

Note

This results are based on the paper published here [CIT2020-BARRACHINA]. Information about the network models and the dataset can be found there.

This results can be replicated by running the following code (changing the input parameters when it corresponds):

from cvnn.montecarlo import run_gaussian_dataset_montecarlo

run_gaussian_dataset_montecarlo(iterations=30, m=10000, n=128, param_list=None,
shape_raw=None, activation='cart_relu', debug=False,
polar=False, do_all=True, dropout=0.5)


Note

Results will be differents to those published because of the following reasons (Fixed on the ArXiv version):

• Since version 0.2.89 the default real mlp model changed using a new definition that will be published in a new article.
• Since version 0.3.48 cvnn started using TensorFlow optimizer which averages gradients by it’s batch size according to this post. This issue was raised officially.
• Default optimizer changed to adam.
• As the dataset is generated randomly. This means two independent runs of run_gaussian_dataset_montecarlo may not have the same confidence intervals and results.
• Disclaimer: All comparisons with a parameter variation was done with the same dataset.

Simulation Results

Method Documentation

run_gaussian_dataset_montecarlo(iterations=1000, m=10000, n=128, param_list=None, epochs=150, batch_size=100, display_freq=1, optimizer='Adam', validation_split=0.2, shape_raw=None, activation='cart_relu', debug=False, polar=False, do_all=True, dropout=None)

This function is used to compare CVNN vs RVNN performance over statistical non-circular data.

1. Generates a complex-valued gaussian correlated noise with the characteristics given by the inputs.

2. It then runs a monte carlo simulation of several iterations of both CVNN and an equivalent RVNN model.

3. Saves several files into ./log/montecarlo/date/of/run/

• run_summary.txt: Summary of the run models and data
• run_data.csv: Full information of performance of iteration of each model at each epoch
• complex_network_statistical_result.csv: Statistical results of all iterations of CVNN per epoch
• real_network_statistical_result.csv: Statistical results of all iterations of RVNN per epoch
• (Optional) plot/ folder with the corresponding plots generated by MonteCarloAnalyzer.do_all()
Parameters: iterations – Number of iterations to be done for each model m – Total size of the dataset (number of examples) n – Number of features / input vector param_list – A list of len = number of classes. Each element of the list is another list of len = 3 with values: [$$\rho$$, $$\sigma_x^2$$, $$\sigma_y^2$$] Example for dataset type A of this paper: param_list = [ [0.5, 1, 1], [-0.5, 1, 1] ]  Default: None will default to the example. epochs – Number of epochs for each iteration batch_size – Batch size at each iteration display_freq – Frequency in terms of epochs of when to do a checkpoint. optimizer – Optimizer to be used. Keras optimizers are not allowed. Can be either cvnn.optimizers.Optimizer or a string listed in opt_dispatcher. validation_split – float between 0 and 1. Fraction of the training data to be used as validation data. The model will set apart this fraction of the training data, will not train on it, and will evaluate the loss and any model metrics on this data at the end of each epoch. The validation data is selected from the last samples in the x and y data provided, before shuffling. This argument is not supported when x is a dataset, generator or keras.utils.Sequence instance. shape_raw – List of sizes of each hidden layer. For example [64] will generate a CVNN with one hidden layer of size 64. Default None will default to example. activation – Activation function to be used at each hidden layer debug – tensorboard – If True, it will generate tensorboard outputs to check training values. polar – Boolean weather the RVNN should receive real and imaginary part (False) or amplitude and phase (True) do_all – If true (default) it creates a plot/ folder with the plots generated by MonteCarloAnalyzer.do_all() dropout – (float) Dropout to be used at each hidden layer. If None it will not use any dropout. (string) Full path to the run_data.csv generated file. It can be used by cvnn.data_analysis.SeveralMonteCarloComparison to compare several runs.
 [CIT2020-BARRACHINA] Jose Agustin Barrachina, Chenfang Ren, Christele Morisseau, Gilles Vieillard, Jean-Philippe Ovarlez “Complex-Valued vs. Real-Valued Neural Networks for Classification Perspectives: An Example on Non-Circular Data” arXiv:2009.08340 ML Stat, Sep. 2020. Available: https://arxiv.org/abs/2009.08340.