Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cosmoANN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Claudio Gheller
cosmoANN
Commits
051924ff
Commit
051924ff
authored
2 years ago
by
Claudio Gheller
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
b1d018f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
evaluate.py
+55
-0
55 additions, 0 deletions
evaluate.py
with
55 additions
and
0 deletions
evaluate.py
0 → 100644
+
55
−
0
View file @
051924ff
import
numpy
as
np
import
h5py
import
tensorflow
as
tf
from
tensorflow.keras.models
import
Sequential
from
tensorflow.keras.layers
import
Dense
from
tensorflow.keras.optimizers
import
Adam
from
tensorflow.keras
import
metrics
from
tensorflow.keras.layers
import
Dropout
from
tensorflow.keras.layers
import
BatchNormalization
from
data_loader
import
*
n_in
=
5
n_out
=
1
infilename
=
"
/m100_work/IscrC_CD-DLS/simulations/
"
rho
,
T
,
vx
,
vy
,
vz
,
Bx
,
By
,
Bz
,
B2
=
load_data
(
infilename
,
[
500
,
500
,
500
],
[
1000
,
1000
,
501
])
n_cells
=
rho
.
size
n_train
=
n_cells
Xtrain
=
np
.
zeros
((
n_train
,
n_in
),
dtype
=
np
.
float64
)
Ytrain
=
np
.
zeros
((
n_train
,
n_out
),
dtype
=
np
.
float64
)
xxx
=
rho
.
flatten
()
Xtrain
[
0
:
n_train
,
0
]
=
xxx
[
0
:
n_train
]
xxx
=
T
.
flatten
()
Xtrain
[
0
:
n_train
,
1
]
=
xxx
[
0
:
n_train
]
xxx
=
vx
.
flatten
()
Xtrain
[
0
:
n_train
,
2
]
=
xxx
[
0
:
n_train
]
xxx
=
vy
.
flatten
()
Xtrain
[
0
:
n_train
,
3
]
=
xxx
[
0
:
n_train
]
xxx
=
vz
.
flatten
()
Xtrain
[
0
:
n_train
,
4
]
=
xxx
[
0
:
n_train
]
Bxx
=
Bx
.
flatten
()
Bxy
=
By
.
flatten
()
Bxz
=
Bz
.
flatten
()
Bx2
=
B2
.
flatten
()
# save the trained network
ckptfile
=
'
models/trained_networ.ckpt
'
model
=
tf
.
keras
.
models
.
load_model
(
ckptfile
)
model
.
summary
()
Ytrain
=
model
.
predict
(
Xtrain
)
print
(
Ytrain
.
shape
)
Bx2
.
tofile
(
'
B.bin
'
)
Xtrain
[:,
0
].
tofile
(
'
rho.bin
'
)
Xtrain
[:,
1
].
tofile
(
'
T.bin
'
)
#B2 = Ytrain[:,0]
#B2.tofile('eval.bin')
Ytrain
[:,
0
].
tofile
(
'
eval.bin
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment