Skip to content

Commit 37f668b

Browse files
committed
adding wandb sensitivity
1 parent 6377ce6 commit 37f668b

File tree

6 files changed

+177
-10
lines changed

6 files changed

+177
-10
lines changed

notebooks/plot_correlation_map.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@
124124
],
125125
"metadata": {
126126
"kernelspec": {
127-
"display_name": "submeso_env",
127+
"display_name": "Python 3 (ipykernel)",
128128
"language": "python",
129-
"name": "submeso_env"
129+
"name": "python3"
130130
},
131131
"language_info": {
132132
"codemirror_mode": {
@@ -138,7 +138,7 @@
138138
"name": "python",
139139
"nbconvert_exporter": "python",
140140
"pygments_lexer": "ipython3",
141-
"version": "3.9.12"
141+
"version": "3.11.3"
142142
}
143143
},
144144
"nbformat": 4,

notebooks/plot_feature_importance.ipynb

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,59 @@
3535
"\n"
3636
]
3737
},
38+
{
39+
"cell_type": "code",
40+
"execution_count": 3,
41+
"metadata": {
42+
"tags": []
43+
},
44+
"outputs": [
45+
{
46+
"name": "stdout",
47+
"output_type": "stream",
48+
"text": [
49+
"Defaulting to user installation because normal site-packages is not writeable\n",
50+
"Collecting wandb\n",
51+
" Downloading wandb-0.17.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.1 MB)\n",
52+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.1/7.1 MB\u001b[0m \u001b[31m38.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n",
53+
"\u001b[?25hRequirement already satisfied: click!=8.0.0,>=7.1 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (8.0.4)\n",
54+
"Collecting docker-pycreds>=0.4.0 (from wandb)\n",
55+
" Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n",
56+
"Collecting gitpython!=3.1.29,>=1.0.0 (from wandb)\n",
57+
" Downloading GitPython-3.1.43-py3-none-any.whl (207 kB)\n",
58+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.3/207.3 kB\u001b[0m \u001b[31m25.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
59+
"\u001b[?25hRequirement already satisfied: platformdirs in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (2.5.2)\n",
60+
"Collecting protobuf!=4.21.0,<6,>=3.19.0 (from wandb)\n",
61+
" Downloading protobuf-5.27.3-cp38-abi3-manylinux2014_x86_64.whl (309 kB)\n",
62+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m309.3/309.3 kB\u001b[0m \u001b[31m33.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
63+
"\u001b[?25hRequirement already satisfied: psutil>=5.0.0 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (5.9.0)\n",
64+
"Requirement already satisfied: pyyaml in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (6.0)\n",
65+
"Requirement already satisfied: requests<3,>=2.0.0 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (2.29.0)\n",
66+
"Collecting sentry-sdk>=1.0.0 (from wandb)\n",
67+
" Downloading sentry_sdk-2.13.0-py2.py3-none-any.whl (309 kB)\n",
68+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m309.1/309.1 kB\u001b[0m \u001b[31m34.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
69+
"\u001b[?25hCollecting setproctitle (from wandb)\n",
70+
" Downloading setproctitle-1.3.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (31 kB)\n",
71+
"Requirement already satisfied: setuptools in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from wandb) (67.8.0)\n",
72+
"Requirement already satisfied: six>=1.4.0 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from docker-pycreds>=0.4.0->wandb) (1.16.0)\n",
73+
"Collecting gitdb<5,>=4.0.1 (from gitpython!=3.1.29,>=1.0.0->wandb)\n",
74+
" Downloading gitdb-4.0.11-py3-none-any.whl (62 kB)\n",
75+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m62.7/62.7 kB\u001b[0m \u001b[31m8.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
76+
"\u001b[?25hRequirement already satisfied: charset-normalizer<4,>=2 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from requests<3,>=2.0.0->wandb) (2.0.4)\n",
77+
"Requirement already satisfied: idna<4,>=2.5 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from requests<3,>=2.0.0->wandb) (3.4)\n",
78+
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from requests<3,>=2.0.0->wandb) (1.26.16)\n",
79+
"Requirement already satisfied: certifi>=2017.4.17 in /home/software/anaconda3/2023.07/lib/python3.11/site-packages (from requests<3,>=2.0.0->wandb) (2023.5.7)\n",
80+
"Collecting smmap<6,>=3.0.1 (from gitdb<5,>=4.0.1->gitpython!=3.1.29,>=1.0.0->wandb)\n",
81+
" Downloading smmap-5.0.1-py3-none-any.whl (24 kB)\n",
82+
"Installing collected packages: smmap, setproctitle, sentry-sdk, protobuf, docker-pycreds, gitdb, gitpython, wandb\n",
83+
"Successfully installed docker-pycreds-0.4.0 gitdb-4.0.11 gitpython-3.1.43 protobuf-5.27.3 sentry-sdk-2.13.0 setproctitle-1.3.3 smmap-5.0.1 wandb-0.17.6\n"
84+
]
85+
}
86+
],
87+
"source": [
88+
"!pip install wandb"
89+
]
90+
},
3891
{
3992
"cell_type": "code",
4093
"execution_count": 2,
@@ -165,9 +218,9 @@
165218
],
166219
"metadata": {
167220
"kernelspec": {
168-
"display_name": "chris_env",
221+
"display_name": "Python 3 (ipykernel)",
169222
"language": "python",
170-
"name": "chris_env"
223+
"name": "python3"
171224
},
172225
"language_info": {
173226
"codemirror_mode": {
@@ -179,7 +232,7 @@
179232
"name": "python",
180233
"nbconvert_exporter": "python",
181234
"pygments_lexer": "ipython3",
182-
"version": "3.9.12"
235+
"version": "3.11.3"
183236
}
184237
},
185238
"nbformat": 4,

notebooks/plot_r2_monthly_mean.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@
376376
],
377377
"metadata": {
378378
"kernelspec": {
379-
"display_name": "chris_env",
379+
"display_name": "Python 3 (ipykernel)",
380380
"language": "python",
381-
"name": "chris_env"
381+
"name": "python3"
382382
},
383383
"language_info": {
384384
"codemirror_mode": {
@@ -390,7 +390,7 @@
390390
"name": "python",
391391
"nbconvert_exporter": "python",
392392
"pygments_lexer": "ipython3",
393-
"version": "3.9.12"
393+
"version": "3.11.3"
394394
}
395395
},
396396
"nbformat": 4,

notebooks/plot_wandb_sensitivity.ipynb

Lines changed: 97 additions & 0 deletions
Large diffs are not rendered by default.

submeso_ml/data/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def __init__(self,input_features = ['grad_B','FCOR', 'HML', 'TAU',
1111
self.seed=seed
1212
self.train_split=train_split
1313
self.input_features=input_features
14-
self.path= '/scratch/ab10313/pleiades/NN_data_'+'%s' % res+'/'
14+
self.path= '/orcd/data/abodner/001/greene/scratch/pleiades/NN_data_'+'%s' % res+'/'
1515
self.loc = loc_num
1616

1717
# load features for input

submeso_ml/models/fcnn.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
import torch
33
import torch.nn as nn
4+
import torch.nn.init as init
45
import numpy as np
56
#import pyqg_explorer.util.transforms as transforms
67
import os
@@ -62,7 +63,23 @@ def __init__(self,config):
6263
## Output layer
6364
blocks.extend(make_block(32,self.config["output_channels"],self.config["kernel_hidden"],'False',False))
6465
self.conv = nn.Sequential(*blocks)
66+
67+
# Initialize weights and biases
68+
self._initialize_weights()
69+
70+
71+
def _initialize_weights(self):
72+
"""
73+
Initialize weights and biases of all layers with a uniform distribution.
74+
"""
75+
for m in self.modules():
76+
if isinstance(m, (nn.Conv2d, nn.Linear)):
77+
init.uniform_(m.weight, a=-self.config["init_bound"], b=self.config["init_bound"])
78+
if m.bias is not None:
79+
init.uniform_(m.bias, a=-self.config["init_bound"], b=self.config["init_bound"])
6580

81+
82+
6683
def forward(self, x):
6784
x = self.conv(x)
6885
return x

0 commit comments

Comments
 (0)