Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
beta-vae-normalizing-flows
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kaan Güney Keklikçi
beta-vae-normalizing-flows
Commits
c1661dc9
Commit
c1661dc9
authored
Oct 18, 2021
by
Kaan Güney Keklikçi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correct ks-test for nice
parent
8506e8f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
beta-vae-nice-thoracic-surgery.ipynb
...ows/thoracic-surgery/beta-vae-nice-thoracic-surgery.ipynb
+10
-6
No files found.
beta-vae-normalizing-flows/thoracic-surgery/beta-vae-nice-thoracic-surgery.ipynb
View file @
c1661dc9
...
...
@@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count":
198
,
"execution_count":
200
,
"id": "9f0b013a",
"metadata": {
"scrolled": true
...
...
@@ -59,7 +59,7 @@
" (0.7775608374378459, 0.8840392521212448, 0.9452007992345052)]"
]
},
"execution_count":
198
,
"execution_count":
200
,
"metadata": {},
"output_type": "execute_result"
}
...
...
@@ -86,7 +86,7 @@
"from tensorflow.keras.layers import Dense, Flatten, Reshape, Input, BatchNormalization\n",
"from tensorflow.keras.losses import Loss\n",
"import scipy\n",
"import ks2d2s\n",
"
from ks2d2s
import ks2d2s\n",
"\n",
"tfd = tfp.distributions\n",
"tfb = tfp.bijectors\n",
...
...
@@ -1359,18 +1359,22 @@
},
{
"cell_type": "code",
"execution_count":
197
,
"execution_count":
226
,
"id": "b31a919e",
"metadata": {},
"outputs": [],
"source": [
"# KS-test\n",
"prior_sample = prior.sample(X_train_copy.shape[0]).numpy()\n",
"post_sample = trainable_dist.sample(X_train_copy.shape[0]).numpy()\n",
"\n",
"with open('ks-test.txt', 'a') as f:\n",
" f.write('NICE FLOW\\n')\n",
" f.write('p-val[prior - target] = {}\\n'.format(ks2d2s(X_train_copy['PRE4'], X_train_copy['PRE5'],prior_sample[...,0], prior_sample[...,1])))\n",
" f.write('p-val[trained - target] = {}\\n'.format(ks2d2s(X_train_copy['PRE4'], X_train_copy['PRE5'],samples['PRE4'], samples['PRE5'])))\n",
" f.write('p-val[training - qtrainable] = {}\\n'.format(ks2d2s(X_train_np[...,0], X_train_np[...,1], prior_sample[...,0], prior_sample[...,1])))\n",
" f.write('p-val[training - qtrained] = {}\\n'.format(ks2d2s(X_train_np[...,0], X_train_np[...,1], post_sample[...,0], post_sample[...,1])))\n",
" \n",
" f.write('p-val[testing - qtrainable] = {}\\n'.format(ks2d2s(X_test_np[...,0], X_test_np[...,1], prior_sample[...,0], prior_sample[...,1])))\n",
" f.write('p-val[testing - qtrained] = {}\\n'.format(ks2d2s(X_test_np[...,0], X_test_np[...,1], post_sample[...,0], post_sample[...,1])))\n",
"f.close()"
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment