Skip to content

Commit

Permalink
upgrade perming[reduce memory burden in jupyter kernel]
Browse files Browse the repository at this point in the history
  • Loading branch information
linjing-lab committed Oct 26, 2023
1 parent dfeb88f commit b998e35
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 26 deletions.
Binary file modified released_box/models/bitcoin.ckpt
Binary file not shown.
2 changes: 1 addition & 1 deletion released_box/perming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@
'Multi-outputs': Ranker
}

__version__ = '1.7.0'
__version__ = '1.7.1'
2 changes: 1 addition & 1 deletion released_box/perming/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def train_val(self,
assert patience >= 10 and patience <= 100, 'Value coordinate with tolerance should fit about num_epochs and batch_size.'
assert n_jobs == -1 or n_jobs > 0, 'Take full jobs with setting n_jobs=-1 or manually set nums of jobs.'
total_step: int = len(self.train_loader)
self.val_container = [*iter(self.val_loader)] # replace previous versions of _set_container
self.val_container = [set for set in self.val_loader] # replace [*iter] to avoid memory burden in jupyter kernel
val_length: int = len(self.val_container)
self.stop_iter: bool = False # init state of train_val
for epoch in range(num_epochs):
Expand Down
43 changes: 19 additions & 24 deletions released_box/tests/Multi-classification Task.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -364,18 +364,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch [1/1], Step [100/3277], Training Loss: 2.5657, Validation Loss: 2.5551\n",
"Epoch [1/1], Step [200/3277], Training Loss: 1.8318, Validation Loss: 1.8269\n",
"Epoch [1/1], Step [300/3277], Training Loss: 1.2668, Validation Loss: 1.2844\n",
"Epoch [1/1], Step [400/3277], Training Loss: 0.9546, Validation Loss: 0.9302\n",
"Epoch [1/1], Step [500/3277], Training Loss: 0.7440, Validation Loss: 0.7169\n",
"Epoch [1/1], Step [600/3277], Training Loss: 0.5863, Validation Loss: 0.5889\n",
"Epoch [1/1], Step [700/3277], Training Loss: 0.5062, Validation Loss: 0.5086\n",
"Epoch [1/1], Step [800/3277], Training Loss: 0.3308, Validation Loss: 0.4563\n",
"Epoch [1/1], Step [900/3277], Training Loss: 0.3079, Validation Loss: 0.4204\n",
"Epoch [1/1], Step [1000/3277], Training Loss: 0.4298, Validation Loss: 0.3946\n",
"Epoch [1/1], Step [1100/3277], Training Loss: 0.3918, Validation Loss: 0.3758\n",
"Epoch [1/1], Step [1200/3277], Training Loss: 0.4366, Validation Loss: 0.3618\n",
"Epoch [1/1], Step [100/3277], Training Loss: 2.6289, Validation Loss: 2.5405\n",
"Epoch [1/1], Step [200/3277], Training Loss: 1.8560, Validation Loss: 1.8456\n",
"Epoch [1/1], Step [300/3277], Training Loss: 1.3494, Validation Loss: 1.2955\n",
"Epoch [1/1], Step [400/3277], Training Loss: 0.9759, Validation Loss: 0.9386\n",
"Epoch [1/1], Step [500/3277], Training Loss: 0.6706, Validation Loss: 0.7154\n",
"Epoch [1/1], Step [600/3277], Training Loss: 0.5756, Validation Loss: 0.5840\n",
"Epoch [1/1], Step [700/3277], Training Loss: 0.5099, Validation Loss: 0.4954\n",
"Process stop at epoch [1/1] with patience 10 within tolerance 0.001\n"
]
}
Expand Down Expand Up @@ -405,7 +400,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"loss of Box on the 104960 test dataset: 0.3505959212779999.\n"
"loss of Box on the 104960 test dataset: 0.46497929096221924.\n"
]
},
{
Expand Down Expand Up @@ -446,9 +441,9 @@
" 'princetonLocky': [100761, 104857],\n",
" 'white': [100761, 104857]}),\n",
" ('loss',\n",
" {'train': 0.330683171749115,\n",
" 'val': 0.3547004163265228,\n",
" 'test': 0.3505959212779999}),\n",
" {'train': 0.5337933897972107,\n",
" 'val': 0.4650214910507202,\n",
" 'test': 0.46497929096221924}),\n",
" ('sorted',\n",
" [('montrealAPT', [100761, 104857]),\n",
" ('montrealComradeCircle', [100761, 104857]),\n",
Expand Down Expand Up @@ -503,7 +498,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"id": "a98cad80",
"metadata": {},
"outputs": [],
Expand All @@ -525,7 +520,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"id": "a771705d",
"metadata": {},
"outputs": [],
Expand All @@ -544,15 +539,15 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"id": "eee8abfb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"loss of Box on the 104960 test dataset: 0.35059523582458496.\n"
"loss of Box on the 104960 test dataset: 0.46509239077568054.\n"
]
},
{
Expand Down Expand Up @@ -593,9 +588,9 @@
" 'princetonLocky': [100761, 104857],\n",
" 'white': [100761, 104857]}),\n",
" ('loss',\n",
" {'train': 0.330683171749115,\n",
" 'val': 0.3547004163265228,\n",
" 'test': 0.35059523582458496}),\n",
" {'train': 0.5337933897972107,\n",
" 'val': 0.4650214910507202,\n",
" 'test': 0.46509239077568054}),\n",
" ('sorted',\n",
" [('montrealAPT', [100761, 104857]),\n",
" ('montrealComradeCircle', [100761, 104857]),\n",
Expand Down Expand Up @@ -628,7 +623,7 @@
" ('white', [100761, 104857])])])"
]
},
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit b998e35

Please sign in to comment.