Skip to content

Commit

Permalink
Merge branch 'main' of github.com:mackelab/labproject into main
Browse files Browse the repository at this point in the history
  • Loading branch information
augustes committed Mar 11, 2024
2 parents f69ba45 + 94e4351 commit a943bb6
Show file tree
Hide file tree
Showing 41 changed files with 3,915 additions and 22,786 deletions.
12 changes: 0 additions & 12 deletions configs/conf_dims.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion configs/conf_main_scaling_experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ augmentation: ['gauss', 'one_dim_shift', 'one_dim_shift',]
n: [10000,10000,10000] #samples
d: [2, 10, 1000] # dimensions

# MMD bandwith parameter
mmd_bandwidth: [[1,1,1], [5,5,5], [10,10,10]]

# sample size experiments
Expand All @@ -23,7 +24,6 @@ runs_dim: 5 # number of sample selection for errorbars
# seed for reproducibility
seed: 0


# for the reduced sample size experiments
#sample_size: [8, 10, 20, 50, 80]
#n: [500, 500, 500]
1 change: 0 additions & 1 deletion configs/conf_mmd_main_scaling_experiment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ runs_dim: 5 # number of sample selection for errorbars
# seed for reproducibility
seed: 0


# for the reduced sample size experiments
#sample_size: [8, 10, 20, 50, 80]
#n: [500, 500, 500]
22 changes: 22 additions & 0 deletions configs/conf_supp_dim_scaling_experiment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exp_log_name: "scaling_dims" # optional but recommended

# datasets to use
data: ["multivariate_normal"]

# number of samples and dimensions
n: [5000]
d: [100]

# MMD bandwidth parameter
mmd_bandwidth: [10., 20., 20.]

# dimensionality scaling experiments
experiments: ["ScaleDimSW", "ScaleDimC2ST", "ScaleDimMMD"]
dim_sizes: [5, 10, 50, 100, 500, 1000]
runs: 5 # number of sample selection for errorbars
distort: ["shift_one", "shift_all", "increase_var"]

# seed for reproducibility
seed: 1404


1,125 changes: 0 additions & 1,125 deletions docs/notebooks/MMD_intro.ipynb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -11,7 +11,7 @@
"0"
]
},
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -37,6 +37,58 @@
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"np.sqrt"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAicAAAGdCAYAAADJ6dNTAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjguMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8g+/7EAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAiYklEQVR4nO3dfXBU1f3H8U8SzKZoEsQMG8KDjK1Q40NiExJhSiWSGYwWH9sy2rEh46B/bGzt1rZkaom22tjfVEyns1NGLEP7RwfEGakjSjuuOIhGHqWDjYjRtEZwA5QxS6Imsjm/PzqsBkLIbnb3npv7fs3sDPfu3bvfk5DsJ+eec26WMcYIAADAEtlOFwAAAPBlhBMAAGAVwgkAALAK4QQAAFiFcAIAAKxCOAEAAFYhnAAAAKsQTgAAgFUmOF1AogYHB3X48GHl5+crKyvL6XIAAMAoGGN04sQJlZSUKDt75L4R14WTw4cPa8aMGU6XAQAAktDV1aXp06ePeIzrwkl+fr6k/zWuoKDA4WoAAMBoRKNRzZgxI/45PhLXhZNTl3IKCgoIJwAAuMxohmQwIBYAAFiFcAIAAKxCOAEAAFYhnAAAAKsQTgAAgFUIJwAAwCqEEwAAYBXCCQAAsArhBAAAWMU14SQUCqm0tFRz5851uhQAAJBGWcYY43QRiYhGoyosLFRPTw/L1wMA4BKJfH67pucEAAB4A+EEAABYxXV3JQYwzm1tOXNfTVPm6wDgGMIJAPudHlgIK8C4RjgB4KzhekoAeBpjTgA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7OTjNt2jSzYMECc/PNN2em2DRItP39/f2msrLS3HDDDWb79u2ms7PTvPLKK2bfvn0ZrjxzCCcWaG9vN5LMrl274vtefPFFk5WVZQ4dOnTW11VXV5sHH3wwEyWmVbLtN8aYN99800ybNs189NFHrg0nY2n/lz399NMmNzfXfP755+koM6WqqqpMIBCIb8diMVNSUmJaWlqGPf573/ueufHGG4fsq66uNvfee29a60yXRNt/upMnT5r8/Hzz5z//OV0lplUy7T958qSZP3++eeqpp0x9fb2rw0mi7f/jH/9oLrnkEjMwMJCpEh3HZR0LtLW1adKkSaqsrIzvq62tVXZ2tnbs2DHsa44cOaIdO3ZoypQpmj9/vvx+v6699lpt3749U2WnTDLtl6RPPvlEd955p0KhkIqLizNRalok2/7T9fT0qKCgQBMm2H3LrIGBAe3Zs0e1tbXxfdnZ2aqtrVVbW9uwr2lraxtyvCQtXrz4rMfbLJn2n+6TTz7R559/rsmTJ6erzLRJtv2/+tWvNGXKFN19992ZKDNtkmn/c889p3nz5ikQCMjv9+uKK67Qb37zG8VisUyVnXGEEwtEIhFNmTJlyL4JEyZo8uTJikQiw77m/ffflyQ99NBDWr58ubZs2aJvfOMbWrRokd59992015xKybRfkn784x9r/vz5uvnmm9NdYlol2/4vO3bsmH7961/rnnvuSUeJKXXs2DHFYjH5/f4h+/1+/1nbG4lEEjreZsm0/3Q///nPVVJSckZgc4Nk2r99+3b96U9/0po1azJRYlol0/73339fzzzzjGKxmF544QX98pe/1OOPP65HHnkkEyU7gnCSRitWrFBWVtaIjwMHDiR17sHBQUnSvffeq4aGBl199dV64oknNGfOHK1duzaVzUhaOtv/3HPP6eWXX1Zra2tqi06hdLb/y6LRqG688UaVlpbqoYceGnvhsNpjjz2m9evX69lnn1VeXp7T5aTdiRMndNddd2nNmjUqKipyuhxHDA4OasqUKXryySdVUVGhpUuX6he/+IVWr17tdGlpY3f/r8v95Cc/0bJly0Y85pJLLlFxcbGOHDkyZP/Jkyd1/Pjxs16umDp1qiSptLR0yP7LLrtMH3zwQfJFp1A62//yyy/rvffe06RJk4bsv/3227VgwQK98sorY6g8NdLZ/lNOnDih66+/Xvn5+Xr22Wd13nnnjbXstCsqKlJOTo66u7uH7O/u7j5re4uLixM63mbJtP+U3/3ud3rsscf00ksv6aqrrkpnmWmTaPvfe+89/fvf/9aSJUvi+079cTZhwgS98847+upXv5reolMome//1KlTdd555yknJye+77LLLlMkEtHAwIByc3PTWrMjnB70gi8GRO7evTu+7+9///uIAyIHBwdNSUnJGQNiy8vLTVNTU1rrTbVk2v/RRx+Z/fv3D3lIMr///e/N+++/n6nSUyKZ9htjTE9Pj7nmmmvMtddea/r6+jJRaspUVVWZxsbG+HYsFjPTpk0bcUDst7/97SH75s2b5+oBsYm03xhjfvvb35qCggLT1taWiRLTKpH2f/rpp2f8rN98883muuuuM/v37zf9/f2ZLD0lEv3+NzU1mYsvvtjEYrH4vtbWVjN16tS01+oUwoklrr/+enP11VebHTt2mO3bt5tLL710yFTSDz/80MyZM8fs2LEjvu+JJ54wBQUFZuPGjebdd981Dz74oMnLyzMdHR1ONGFMkmn/6eTS2TrGJN7+np4eU11dba688krT0dFhPvroo/jj5MmTTjVj1NavX298Pp9Zt26daW9vN/fcc4+ZNGmSiUQixhhj7rrrLrNixYr48a+99pqZMGGC+d3vfmfefvtt09zc7PqpxIm0/7HHHjO5ubnmmWeeGfK9PnHihFNNGJNE2386t8/WSbT9H3zwgcnPzzeNjY3mnXfeMc8//7yZMmWKeeSRR5xqQtoRTizx3//+19xxxx3mggsuMAUFBaahoWHIL57Ozk4jyWzdunXI61paWsz06dPNxIkTzbx588yrr76a4cpTI9n2f5mbw0mi7d+6dauRNOyjs7PTmUYk6A9/+IOZOXOmyc3NNVVVVeaNN96IP3fttdea+vr6Icc//fTTZvbs2SY3N9dcfvnlZvPmzRmuOLUSaf/FF1887Pe6ubk584WnSKLf/y9zezgxJvH2v/7666a6utr4fD5zySWXmEcffdQVf4gkK8sYYzJ7IQkAAODsmK0DAACsQjgBAABWIZwAAACrEE4AAIBVCCcAAMAqhBMAAGAVwgkAALAK4QQAAFiFcAIAAKxCOAEAAFYhnAAAAKsQTgAAgFX+Hz4olukS2vnGAAAAAElFTkSuQmCC",
"text/plain": [
"<Figure size 640x480 with 1 Axes>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"w=1.4\n",
"sd=3\n",
"dg=4\n",
"N=400\n",
"a = np.random.randn(N,N)/np.sqrt(N)\n",
"\n",
"covariance_matrix=np.array([\n",
" [dg,0,sd,-w],\n",
" [0,dg,w,sd],\n",
" [sd,w,dg,0],\n",
" [-w,sd,0,dg],\n",
"])\n",
"N=50\n",
"loadings = np.random.randn(N,4)@np.linalg.cholesky(covariance_matrix)/np.sqrt(N)\n",
"n1=loadings[:,0]\n",
"n2=loadings[:,1]\n",
"m1=loadings[:,2]\n",
"m2=loadings[:,3]\n",
"plt.hist(a.flatten(),bins=100)\n",
"\n",
"perturbation = np.outer(n1,m1)+np.outer(n2,m2)\n",
"a[:N,:N]+=perturbation*2\n",
"plt.hist(a.flatten(),bins=100,alpha=0.5)\n",
"plt.yscale('log')"
]
},
{
"cell_type": "code",
"execution_count": 2,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit a943bb6

Please sign in to comment.