From 70933ad8c0356c231a257edeb7b84687e8fc0970 Mon Sep 17 00:00:00 2001 From: Astitva Aggarwal Date: Tue, 16 Jan 2024 18:23:55 +0530 Subject: [PATCH] updated low_level_2.md --- docs/src/tutorials/low_level_2.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/src/tutorials/low_level_2.md b/docs/src/tutorials/low_level_2.md index 2923160a4c..00929ec72f 100644 --- a/docs/src/tutorials/low_level_2.md +++ b/docs/src/tutorials/low_level_2.md @@ -90,7 +90,15 @@ datasetpde = [generate_dataset_matrix(domains, dx, dt)] noisydataset = deepcopy(datasetpde) noisydataset[1][:, 1] = noisydataset[1][:, 1] .+ randn(size(noisydataset[1][:, 1])) .* 5 / 100 .* noisydataset[1][:, 1] +``` + +Plotting dataset, added noise is set at 5%. +```@example low_level_2 +plot(datasetpde[1][:, 2], datasetpde[1][:, 1], title="Dataset from Analytical Solution") +plot!(noisydataset[1][:, 2], noisydataset[1][:, 1]) +``` +```@example low_level_2 # Neural network chain = Lux.Chain(Lux.Dense(2, 8, Lux.tanh), Lux.Dense(8, 8, Lux.tanh), @@ -119,10 +127,6 @@ sol1 = ahmc_bayesian_pinn_pde(pde_system, And some analysis: ```@example low_level_2 -# Dataset -plot(datasetpde[1][:, 2], datasetpde[1][:, 1], title="Dataset from Analytical Solution") -plot!(noisydataset[1][:, 2], noisydataset[1][:, 1]) - phi = discretization.phi[1] xs, ts = [infimum(d.domain):dx:supremum(d.domain) for (d, dx) in zip(domains, [dx / 10, dt])] u_predict = [[first(pmean(phi([x, t], sol1.estimated_nn_params[1]))) for x in xs]