Skip to content

Commit dff9798

Browse files
committed
adding self.intrinsic_dim to BID class
1 parent d614309 commit dff9798

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

dadapy/hamming.py

+2
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def __init__(
448448
self.export_results = export_results
449449
self.export_logKLs = export_logKLs
450450
self.L = L
451+
self.intrinsic_dim = self.d0
451452

452453
self.key0 = random.PRNGKey(self.seed)
453454
self.optfolder0 = optfolder0
@@ -605,6 +606,7 @@ def computeBID(
605606
self.d1 = self.Op.d1.item()
606607
self.logKL = jnp.log(self.Op.KL).item()
607608
self.Pmodel = np.array(self.Op.Pmodel)
609+
self.intrinsic_dim = self.d0
608610

609611
def load_results(
610612
self,

examples/notebook_hamming.ipynb

+11-6
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
{
7474
"cell_type": "code",
75-
"execution_count": 37,
75+
"execution_count": 1,
7676
"metadata": {},
7777
"outputs": [],
7878
"source": [
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"cell_type": "code",
94-
"execution_count": 38,
94+
"execution_count": 2,
9595
"metadata": {},
9696
"outputs": [],
9797
"source": [
@@ -105,7 +105,7 @@
105105
},
106106
{
107107
"cell_type": "code",
108-
"execution_count": 39,
108+
"execution_count": 3,
109109
"metadata": {},
110110
"outputs": [
111111
{
@@ -152,7 +152,7 @@
152152
},
153153
{
154154
"cell_type": "code",
155-
"execution_count": 40,
155+
"execution_count": 4,
156156
"metadata": {},
157157
"outputs": [
158158
{
@@ -166,7 +166,9 @@
166166
"B.d0=99.57444692619558\n",
167167
"B.d1=0.008277386221249374\n",
168168
"B.logKL=-10.85470780641487\n",
169-
"B.rmax=76\n"
169+
"B.rmax=76\n",
170+
"\n",
171+
" B.intrinsic_dim=99.57444692619558\n"
170172
]
171173
}
172174
],
@@ -199,7 +201,10 @@
199201
"print(f'{B.d0=}')\n",
200202
"print(f'{B.d1=}')\n",
201203
"print(f'{B.logKL=}')\n",
202-
"print(f'{B.rmax=}')"
204+
"print(f'{B.rmax=}')\n",
205+
"\n",
206+
"# Note that B.intrinsic_dim is another alias for B.d0\n",
207+
"print(f'\\n {B.intrinsic_dim=}')"
203208
]
204209
},
205210
{

0 commit comments

Comments
 (0)