diff --git a/EIVPackage/EIVData/cubic.py b/EIVPackage/EIVData/cubic.py index 6b11da7a0d22dfa97b8b8d3ce62038c72ce989dc..710ea870d532d26d7a86bec1c05b71cfa844158b 100644 --- a/EIVPackage/EIVData/cubic.py +++ b/EIVPackage/EIVData/cubic.py @@ -5,11 +5,11 @@ from torch.utils.data import TensorDataset from EIVGeneral.manipulate_tensors import add_noise, normalize_tensor,\ unnormalize_tensor -total_number_of_datapoints = 2000 +total_number_of_datapoints = 500 input_range = [-4,4] slope = 1.0 intercept = 0.0 -x_noise_strength = 0.05 * (input_range[1] - input_range[0])/2 +x_noise_strength = 0.2 y_noise_strength = 3 func = lambda true_x: slope * true_x**3 + intercept diff --git a/EIVPackage/EIVData/linear.py b/EIVPackage/EIVData/linear.py index dc2959dc91b50bc771e3ad36c20763dd944852ec..97d2cd951e0d86650c9ab85af17d5ceb96312375 100644 --- a/EIVPackage/EIVData/linear.py +++ b/EIVPackage/EIVData/linear.py @@ -5,11 +5,11 @@ from torch.utils.data import TensorDataset from EIVGeneral.manipulate_tensors import add_noise, normalize_tensor,\ unnormalize_tensor -total_number_of_datapoints = 2000 +total_number_of_datapoints = 500 input_range = [-1,1] slope = 1.0 intercept = 0.0 -x_noise_strength = 0.05 +x_noise_strength = 0.1 y_noise_strength = 0.1 func = lambda true_x: slope * true_x + intercept diff --git a/EIVPackage/EIVData/quadratic.py b/EIVPackage/EIVData/quadratic.py index 27e83d693499155345f0efdadbedfb02a052bcc9..655e6bf8455a73f537795782fa61fde6fb0b5cec 100644 --- a/EIVPackage/EIVData/quadratic.py +++ b/EIVPackage/EIVData/quadratic.py @@ -5,11 +5,11 @@ from torch.utils.data import TensorDataset from EIVGeneral.manipulate_tensors import add_noise, normalize_tensor,\ unnormalize_tensor -total_number_of_datapoints = 2000 +total_number_of_datapoints = 500 input_range = [-1,1] slope = 1.0 intercept = 0.0 -x_noise_strength = 0.05 +x_noise_strength = 0.1 y_noise_strength = 0.1 func = lambda true_x: slope * true_x**2 + intercept diff --git a/EIVPackage/EIVData/sine.py b/EIVPackage/EIVData/sine.py index 308a308c3786a8046a207416b47e85cdcafd2485..cde80d349eef58cadab44b79f0937d52a90e8d41 100644 --- a/EIVPackage/EIVData/sine.py +++ b/EIVPackage/EIVData/sine.py @@ -9,7 +9,7 @@ total_number_of_datapoints = 2000 input_range = [-0.2,0.8] intercept = 0.0 x_noise_strength = 0.02 -y_noise_strength = 0.05 +y_noise_strength = 0.02 func = lambda true_x: true_x +\ torch.sin(2 * torch.pi * true_x) +\ torch.sin(4 * torch.pi * true_x) diff --git a/Experiments/configurations/eiv_cubic.json b/Experiments/configurations/eiv_cubic.json index 9f9f7d87a05c89afe6efbedfef8789700b3ab9d5..2a3ac2c6696175d083c2b6b7bcab90b614842f7c 100644 --- a/Experiments/configurations/eiv_cubic.json +++ b/Experiments/configurations/eiv_cubic.json @@ -3,7 +3,7 @@ "short_dataname": "cubic", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, @@ -16,7 +16,7 @@ "init_std_y_list": [0.5], "gamma": 0.5, "hidden_layers": [128, 128, 128, 128], - "fixed_std_x": 0.05, + "fixed_std_x": 0.20, "seed_range": [0,10], "gpu_number": 1 } diff --git a/Experiments/configurations/eiv_linear.json b/Experiments/configurations/eiv_linear.json index 57547336d1cbeca9cc993541c01c318887e43b40..8b7ebe0767411186d51ca18dde9d2d6aeb92de06 100644 --- a/Experiments/configurations/eiv_linear.json +++ b/Experiments/configurations/eiv_linear.json @@ -3,7 +3,7 @@ "short_dataname": "linear", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, @@ -16,7 +16,7 @@ "init_std_y_list": [0.5], "gamma": 0.5, "hidden_layers": [128, 128, 128, 128], - "fixed_std_x": 0.05, + "fixed_std_x": 0.10, "seed_range": [0,10], "gpu_number": 1 } diff --git a/Experiments/configurations/eiv_quadratic.json b/Experiments/configurations/eiv_quadratic.json index 7fd2bada4733777f4035ca58cb077394d9ea1b71..c774bbed09beb17e65c475fdfedfca1c795682a7 100644 --- a/Experiments/configurations/eiv_quadratic.json +++ b/Experiments/configurations/eiv_quadratic.json @@ -3,7 +3,7 @@ "short_dataname": "quadratic", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, @@ -16,7 +16,7 @@ "init_std_y_list": [0.5], "gamma": 0.5, "hidden_layers": [128, 128, 128, 128], - "fixed_std_x": 0.05, + "fixed_std_x": 0.10, "seed_range": [0,10], "gpu_number": 1 } diff --git a/Experiments/configurations/eiv_sine.json b/Experiments/configurations/eiv_sine.json index b2cce34aa43b3823911a0021ed3667f8ab59abd8..1195ea0891ab3dc49745b0c9b310416cc2ee0ba9 100644 --- a/Experiments/configurations/eiv_sine.json +++ b/Experiments/configurations/eiv_sine.json @@ -3,7 +3,7 @@ "short_dataname": "sine", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, diff --git a/Experiments/configurations/noneiv_cubic.json b/Experiments/configurations/noneiv_cubic.json index 06a1cf346600407edcdb3b84c2d83c41cd567313..6f71af1d77db1a357f0d68edfe192cc06578d3af 100644 --- a/Experiments/configurations/noneiv_cubic.json +++ b/Experiments/configurations/noneiv_cubic.json @@ -3,7 +3,7 @@ "short_dataname": "cubic", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, diff --git a/Experiments/configurations/noneiv_linear.json b/Experiments/configurations/noneiv_linear.json index 7e775368fc26eaeffc6d2120c0fb0a7cf9542dd3..ae3040e2b157bc7bd10cfd73d9f4f5448f4cf023 100644 --- a/Experiments/configurations/noneiv_linear.json +++ b/Experiments/configurations/noneiv_linear.json @@ -3,7 +3,7 @@ "short_dataname": "linear", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, diff --git a/Experiments/configurations/noneiv_quadratic.json b/Experiments/configurations/noneiv_quadratic.json index 699cfa7d2234c4759fcf8fd191ae2cbaf2a3d7c0..405263797ff8b9ffa3ef692540b0db5edc506cda 100644 --- a/Experiments/configurations/noneiv_quadratic.json +++ b/Experiments/configurations/noneiv_quadratic.json @@ -3,7 +3,7 @@ "short_dataname": "quadratic", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, diff --git a/Experiments/configurations/noneiv_sine.json b/Experiments/configurations/noneiv_sine.json index b7f9e15c18a8c9f9fd052c1a1c4f2a717466d63c..cc889194d725b1e167b1129d444e12720e2610a0 100644 --- a/Experiments/configurations/noneiv_sine.json +++ b/Experiments/configurations/noneiv_sine.json @@ -3,7 +3,7 @@ "short_dataname": "sine", "normalize": false, "lr": 1e-3, - "batch_size": 64, + "batch_size": 16, "test_batch_size": 800, "number_of_epochs": 100, "unscaled_reg": 10, diff --git a/Experiments/plot_prediction.py b/Experiments/plot_prediction.py index 3d91d480570fe682c9e87c9f682f68b6a2e7a840..9ba7fd80c14251c9b22a4de7653f5afb63c9bc27 100644 --- a/Experiments/plot_prediction.py +++ b/Experiments/plot_prediction.py @@ -216,9 +216,8 @@ def compute_predictions_and_uncertainties(data, x_range, eiv, number_of_draws, return plotting_dictionary -data_list = ['cubic'] # short datanames -#TODO: Check which ranges are "correct" -list_x_range = [torch.linspace(-2.5,2.5, 50)] +data_list = ['sine'] # short datanames +list_x_range = [torch.linspace(-0.3,0.9, 50)] list_color = [('red','blue')] list_number_of_draws = [((100,5), 100)] for i, (data, x_range, color, number_of_draws) in enumerate(zip(data_list, @@ -258,5 +257,4 @@ for i, (data, x_range, color, number_of_draws) in enumerate(zip(data_list, pass -plt.show() - +plt.show()