Agarwal commited on
Commit
07df88c
·
1 Parent(s): 6662f44

update corrections and network

Browse files
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ *.ipynb_checkpoints*
2
+ __pycache__
.ipynb_checkpoints/app-checkpoint.py CHANGED
@@ -31,7 +31,7 @@ if raq_ra is not None and fkt is not None and fkv is not None:
31
 
32
  ### calculates temperature profile ###
33
  x_in = get_input(r_list, t_list, v_list, y_prof)
34
- y_pred_nn_pointwise = get_profile(x_in, mlp, num_sims=len(r_list), num_points=num_points)
35
  ### calculates temperature profile ###
36
 
37
  ### writes out temperature profile ###
 
31
 
32
  ### calculates temperature profile ###
33
  x_in = get_input(r_list, t_list, v_list, y_prof)
34
+ y_pred_nn_pointwise = get_profile(x_in, mlp, num_sims=len(r_list), prof_points=num_points)
35
  ### calculates temperature profile ###
36
 
37
  ### writes out temperature profile ###
.ipynb_checkpoints/calculate_profiles-checkpoint.py CHANGED
@@ -7,7 +7,7 @@ write_file = True
7
  plot_profile = True
8
  #### Define outputs ####
9
 
10
- with open('numpy_networks/mlp_[128, 128, 128, 128].pkl', 'rb') as file:
11
  mlp = pickle.load(file)
12
 
13
  f_nn = "my_simulation_parameters.txt"
 
7
  plot_profile = True
8
  #### Define outputs ####
9
 
10
+ with open('numpy_networks/mlp_[128, 128, 128, 128, 128].pkl', 'rb') as file:
11
  mlp = pickle.load(file)
12
 
13
  f_nn = "my_simulation_parameters.txt"
.ipynb_checkpoints/utils-checkpoint.py CHANGED
@@ -59,10 +59,11 @@ def get_profile(inp, mlp, num_sims=1, correction=True, prof_points=128):
59
  res.append(y_pred)
60
 
61
  y_pred = y_pred.reshape(num_sims, -1)
 
 
 
62
 
63
  if correction:
64
- y_pred[:,0] = 1.
65
- y_pred[:,-1] = 0.
66
  inp = inp.reshape(num_sims, -1, inp.shape[-1])
67
 
68
  for sim_ind in range(num_sims):
@@ -70,4 +71,9 @@ def get_profile(inp, mlp, num_sims=1, correction=True, prof_points=128):
70
  slope = (0 - y_pred[sim_ind,inds[0]])/(0 - inp[sim_ind,inds[0],3:4])
71
  y_pred[sim_ind,inds] = slope*inp[sim_ind,inds,3]
72
 
 
 
 
 
 
73
  return y_pred
 
59
  res.append(y_pred)
60
 
61
  y_pred = y_pred.reshape(num_sims, -1)
62
+
63
+ y_pred[:,0] = 1.
64
+ y_pred[:,-1] = 0.
65
 
66
  if correction:
 
 
67
  inp = inp.reshape(num_sims, -1, inp.shape[-1])
68
 
69
  for sim_ind in range(num_sims):
 
71
  slope = (0 - y_pred[sim_ind,inds[0]])/(0 - inp[sim_ind,inds[0],3:4])
72
  y_pred[sim_ind,inds] = slope*inp[sim_ind,inds,3]
73
 
74
+ inds = np.where(inp[sim_ind,:,3] > 0.985)[0]
75
+ x_old = [inp[sim_ind,inds[-1],3], 1]
76
+ y_old = [y_pred[sim_ind,inds[-1]], 1]
77
+ y_pred[sim_ind,inds] = np.interp(inp[sim_ind,inds,3:4], x_old, y_old).flatten()
78
+
79
  return y_pred
calculate_profiles.py CHANGED
@@ -7,7 +7,7 @@ write_file = True
7
  plot_profile = True
8
  #### Define outputs ####
9
 
10
- with open('numpy_networks/mlp_[128, 128, 128, 128].pkl', 'rb') as file:
11
  mlp = pickle.load(file)
12
 
13
  f_nn = "my_simulation_parameters.txt"
 
7
  plot_profile = True
8
  #### Define outputs ####
9
 
10
+ with open('numpy_networks/mlp_[128, 128, 128, 128, 128].pkl', 'rb') as file:
11
  mlp = pickle.load(file)
12
 
13
  f_nn = "my_simulation_parameters.txt"
numpy_networks/mlp_[128, 128, 128, 128, 128, 128].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7eb1ad0393e4b6d12cbe3376230ffe8d811326717db3a356095ef029dff1a66d
3
+ size 663171
numpy_networks/mlp_[128, 128, 128, 128, 128].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:69b6a28a0cfdda761fcec6c5ed1ac9e19df5ed9504b32bf9328b43827afeeda7
3
+ size 530994
numpy_networks/mlp_[128, 128, 128, 128].pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:85be341485884deee8ffd60e9a854abda9195417fcbadc5505e1e01dd03631d8
3
  size 398817
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39523215bccf6f20a671edd6adb1b65d10a7a20115ec9ec0670b5e8f369c4edf
3
  size 398817
numpy_networks/mlp_[128, 128, 128].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7009d3c883c77ed9dd53fc44cf55b323f84bba5c52159861a28f25d9c412fa50
3
+ size 266640
numpy_networks/mlp_[128, 128].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:51627330fe64a9fd2a5b6198cb209853584972512dd73da4118df54375b0e71b
3
+ size 134463
numpy_networks/mlp_[256, 256, 256, 256, 256, 256].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:672cb15e0dae80fefe53da0f832dfd0f147f7643ab30b02a0d54b594231bad86
3
+ size 2636435
numpy_networks/mlp_[256, 256, 256, 256, 256].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5828bfea28eccff06cf5109b6002a25f6a470d50331cbc7ccce3725cf7dd8cb5
3
+ size 2110015
numpy_networks/mlp_[256, 256, 256, 256].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7baca598d3a5414674ed549f6120ee494f014a848698218324f36be4e3a36e0f
3
+ size 1583595
numpy_networks/mlp_[256, 256, 256].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:119cfd2bf6876921622d961978be13bf9e76655c26a944638f1f1479b21e3a0a
3
+ size 1057175
numpy_networks/mlp_[256, 256].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5019af037528a3efabc903bdb3735d799ba9d016d514e6c63266df4a8fc14011
3
+ size 530755
numpy_networks/mlp_[32, 32, 32, 32, 32, 32].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e9e39e33675981abaa0d1674737b0a788d72bc66f90de005a70c0f8b4813ce6
3
+ size 43347
numpy_networks/mlp_[32, 32, 32, 32, 32].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:12b86e25c4d005f478119be246cc973dfc1c542ed1a2531a6322e2f9b424818e
3
+ size 34827
numpy_networks/mlp_[32, 32, 32, 32].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e3da8534bda1bce422f942aafa425bca4f0b47773f0c578f40bddd1e3f3d15ae
3
+ size 26307
numpy_networks/mlp_[32, 32, 32].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09598633a0335e4355f04e6a8677246e0fd5184e1f7cff614c56460ad6beeb66
3
+ size 17787
numpy_networks/mlp_[32, 32].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fc073bcaa78ee58a07fb5c07fab5282da6693655d9b967af1c416583a3d718d
3
+ size 9267
numpy_networks/mlp_[64, 64, 64, 64, 64, 64].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f91d0aaa659b7f1cbeb0ad9f612c3f1ef8bb4bd4e938d6c96cf07a935ff4dc0f
3
+ size 168040
numpy_networks/mlp_[64, 64, 64, 64, 64].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb8805fa0a9d15dd39196e0fa92794a370db939c35f31cda9648007bc5f9ea05
3
+ size 134688
numpy_networks/mlp_[64, 64, 64, 64].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a0dafb3fd3584048e24bec8594874354f0d29ce08edc8b9b21b9ded99a3f8f05
3
+ size 101327
numpy_networks/mlp_[64, 64, 64].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24154d67801715b4d81aeb6ecde6c41cbd95315d429889adb1714e2050ee265e
3
+ size 67975
numpy_networks/mlp_[64, 64].pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5175a30e025770434577129b3d32e7b64f8e3af8df7d65b670a66922e51d2b0
3
+ size 34614
utils.py CHANGED
@@ -59,10 +59,11 @@ def get_profile(inp, mlp, num_sims=1, correction=True, prof_points=128):
59
  res.append(y_pred)
60
 
61
  y_pred = y_pred.reshape(num_sims, -1)
 
 
 
62
 
63
  if correction:
64
- y_pred[:,0] = 1.
65
- y_pred[:,-1] = 0.
66
  inp = inp.reshape(num_sims, -1, inp.shape[-1])
67
 
68
  for sim_ind in range(num_sims):
@@ -70,4 +71,9 @@ def get_profile(inp, mlp, num_sims=1, correction=True, prof_points=128):
70
  slope = (0 - y_pred[sim_ind,inds[0]])/(0 - inp[sim_ind,inds[0],3:4])
71
  y_pred[sim_ind,inds] = slope*inp[sim_ind,inds,3]
72
 
 
 
 
 
 
73
  return y_pred
 
59
  res.append(y_pred)
60
 
61
  y_pred = y_pred.reshape(num_sims, -1)
62
+
63
+ y_pred[:,0] = 1.
64
+ y_pred[:,-1] = 0.
65
 
66
  if correction:
 
 
67
  inp = inp.reshape(num_sims, -1, inp.shape[-1])
68
 
69
  for sim_ind in range(num_sims):
 
71
  slope = (0 - y_pred[sim_ind,inds[0]])/(0 - inp[sim_ind,inds[0],3:4])
72
  y_pred[sim_ind,inds] = slope*inp[sim_ind,inds,3]
73
 
74
+ inds = np.where(inp[sim_ind,:,3] > 0.985)[0]
75
+ x_old = [inp[sim_ind,inds[-1],3], 1]
76
+ y_old = [y_pred[sim_ind,inds[-1]], 1]
77
+ y_pred[sim_ind,inds] = np.interp(inp[sim_ind,inds,3:4], x_old, y_old).flatten()
78
+
79
  return y_pred