\u001b[0m:\u001b[94m33\u001b[0m \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m30 \u001b[0m\u001b[2m│ │ \u001b[0m]) \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m31 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m32 \u001b[0m\u001b[2m│ \u001b[0m\u001b[2m# FIXME not all the hidden state are the same size, wat\u001b[0m \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m33 \u001b[2m│ \u001b[0mres = [np.concatenate(r) \u001b[94mfor\u001b[0m r \u001b[95min\u001b[0m \u001b[96mzip\u001b[0m(*res)] \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m34 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mreturn\u001b[0m res \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m35 \u001b[0m\u001b[2m│ \u001b[0mall_neg_hs, all_pos_hs, all_gt_labels, all_neg_ans, all_pos_ans = res \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m \u001b[2m36 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mreturn\u001b[0m all_neg_hs, all_pos_hs, all_gt_labels, all_neg_ans, all_pos_ans \u001b[31m│\u001b[0m\n",
- "\u001b[31m│\u001b[0m in \u001b[92mconcatenate\u001b[0m:\u001b[94m200\u001b[0m \u001b[31m│\u001b[0m\n",
- "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
- "\u001b[1;91mValueError: \u001b[0mall the input array dimensions except for the concatenation axis must match exactly, but along \n",
- "dimension \u001b[1;36m1\u001b[0m, the array at index \u001b[1;36m0\u001b[0m has size \u001b[1;36m2285568\u001b[0m and the array at index \u001b[1;36m1\u001b[0m has size \u001b[1;36m1908736\u001b[0m\n"
+ "0"
]
},
+ "execution_count": 21,
"metadata": {},
- "output_type": "display_data"
+ "output_type": "execute_result"
}
],
"source": [
@@ -1104,11 +1023,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 22,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.641742Z",
- "start_time": "2023-05-20T01:57:03.641735Z"
+ "end_time": "2023-05-20T02:28:35.749712Z",
+ "start_time": "2023-05-20T02:28:35.749703Z"
}
},
"outputs": [],
@@ -1118,14 +1037,25 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 23,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.642523Z",
- "start_time": "2023-05-20T01:57:03.642517Z"
+ "end_time": "2023-05-20T02:28:35.750431Z",
+ "start_time": "2023-05-20T02:28:35.750421Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "(0.40796318527410963, 0.4257703081232493)"
+ ]
+ },
+ "execution_count": 23,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"# roc_auc_score\n",
"pos_score = roc_auc_score(y, all_pos_ans)\n",
@@ -1147,15 +1077,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 24,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.643517Z",
- "start_time": "2023-05-20T01:57:03.643507Z"
+ "end_time": "2023-05-20T02:28:35.751184Z",
+ "start_time": "2023-05-20T02:28:35.751175Z"
},
"scrolled": true
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "(0.49, 0.51)"
+ ]
+ },
+ "execution_count": 24,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
"source": [
"# accuracy_score\n",
"pos_score = accuracy_score(y, (all_pos_ans>0.)*1.0)\n",
@@ -1176,14 +1117,23 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 25,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.644197Z",
- "start_time": "2023-05-20T01:57:03.644190Z"
+ "end_time": "2023-05-20T02:28:35.751934Z",
+ "start_time": "2023-05-20T02:28:35.751926Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Logistic regression accuracy: 1.0 [TRAIN]\n",
+ "Logistic regression accuracy: 0.94 [TEST]\n"
+ ]
+ }
+ ],
"source": [
"# let's create a simple 50/50 train split (the data is already randomized)\n",
"n = len(y)\n",
@@ -1227,11 +1177,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 26,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.644851Z",
- "start_time": "2023-05-20T01:57:03.644841Z"
+ "end_time": "2023-05-20T02:28:35.752548Z",
+ "start_time": "2023-05-20T02:28:35.752540Z"
}
},
"outputs": [],
@@ -1282,11 +1232,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 27,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.645452Z",
- "start_time": "2023-05-20T01:57:03.645446Z"
+ "end_time": "2023-05-20T02:28:35.753297Z",
+ "start_time": "2023-05-20T02:28:35.753288Z"
}
},
"outputs": [],
@@ -1305,11 +1255,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 28,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.645991Z",
- "start_time": "2023-05-20T01:57:03.645985Z"
+ "end_time": "2023-05-20T02:28:35.754161Z",
+ "start_time": "2023-05-20T02:28:35.754151Z"
}
},
"outputs": [],
@@ -1378,15 +1328,186 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 29,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.646546Z",
- "start_time": "2023-05-20T01:57:03.646539Z"
+ "end_time": "2023-05-20T02:28:35.754973Z",
+ "start_time": "2023-05-20T02:28:35.754964Z"
},
"scrolled": true
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "Found cached dataset amazon_polarity (/home/ubuntu/.cache/huggingface/datasets/amazon_polarity/amazon_polarity/3.0.0/a27b32b7e7b88eb274a8fa8ba0f654f1fe998a87c22547557317793b5d2772dc)\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:87 │\n",
+ "│ │\n",
+ "│ 84 │\n",
+ "│ 85 # test │\n",
+ "│ 86 dm = IMBDHSDataModule(model, tokenizer) │\n",
+ "│ ❱ 87 dm.setup('train') │\n",
+ "│ 88 dl = dm.val_dataloader() │\n",
+ "│ 89 b = next(iter(dl)) │\n",
+ "│ 90 b │\n",
+ "│ │\n",
+ "│ in setup:32 │\n",
+ "│ │\n",
+ "│ 29 │ │ │\n",
+ "│ 30 │ │ self.dataset = load_dataset(self.hparams.dataset_name, split=\"test\") │\n",
+ "│ 31 │ │ │\n",
+ "│ ❱ 32 │ │ neg_hs, pos_hs, y, all_neg_ans, all_pos_ans = get_hidden_states_many_examples( │\n",
+ "│ 33 │ │ │ self.model, self.tokenizer, self.dataset, self.hparams.model_type, n=self.hp │\n",
+ "│ 34 │ │ │\n",
+ "│ 35 │ │ # let's create a simple 50/50 train split (the data is already randomized) │\n",
+ "│ │\n",
+ "│ in get_hidden_states_many_examples:14 │\n",
+ "│ │\n",
+ "│ 11 │ │\n",
+ "│ 12 │ res = [] │\n",
+ "│ 13 │ │\n",
+ "│ ❱ 14 │ ds_subset = data['test'].shuffle(42).select(range(n)) │\n",
+ "│ 15 │ dl = DataLoader(ds_subset, batch_size=batch_size, shuffle=True) │\n",
+ "│ 16 │ for batch in tqdm(dl): │\n",
+ "│ 17 │ │ text, true_label = batch[\"content\"], batch[\"label\"] │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/arrow_dataset.py:2778 in │\n",
+ "│ __getitem__ │\n",
+ "│ │\n",
+ "│ 2775 │ │\n",
+ "│ 2776 │ def __getitem__(self, key): # noqa: F811 │\n",
+ "│ 2777 │ │ \"\"\"Can be used to index columns (by string names) or rows (by integer index or i │\n",
+ "│ ❱ 2778 │ │ return self._getitem(key) │\n",
+ "│ 2779 │ │\n",
+ "│ 2780 │ def __getitems__(self, keys: List) -> List: │\n",
+ "│ 2781 │ │ \"\"\"Can be used to get a batch using a list of integers indices.\"\"\" │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/arrow_dataset.py:2762 in │\n",
+ "│ _getitem │\n",
+ "│ │\n",
+ "│ 2759 │ │ format_kwargs = kwargs[\"format_kwargs\"] if \"format_kwargs\" in kwargs else self._ │\n",
+ "│ 2760 │ │ format_kwargs = format_kwargs if format_kwargs is not None else {} │\n",
+ "│ 2761 │ │ formatter = get_formatter(format_type, features=self._info.features, **format_kw │\n",
+ "│ ❱ 2762 │ │ pa_subtable = query_table(self._data, key, indices=self._indices if self._indice │\n",
+ "│ 2763 │ │ formatted_output = format_table( │\n",
+ "│ 2764 │ │ │ pa_subtable, key, formatter=formatter, format_columns=format_columns, output │\n",
+ "│ 2765 │ │ ) │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/formatting/formatting.py: │\n",
+ "│ 575 in query_table │\n",
+ "│ │\n",
+ "│ 572 │ if not isinstance(key, (int, slice, range, str, Iterable)): │\n",
+ "│ 573 │ │ _raise_bad_key_type(key) │\n",
+ "│ 574 │ if isinstance(key, str): │\n",
+ "│ ❱ 575 │ │ _check_valid_column_key(key, table.column_names) │\n",
+ "│ 576 │ else: │\n",
+ "│ 577 │ │ size = indices.num_rows if indices is not None else table.num_rows │\n",
+ "│ 578 │ │ _check_valid_index_key(key, size) │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/formatting/formatting.py: │\n",
+ "│ 515 in _check_valid_column_key │\n",
+ "│ │\n",
+ "│ 512 │\n",
+ "│ 513 def _check_valid_column_key(key: str, columns: List[str]) -> None: │\n",
+ "│ 514 │ if key not in columns: │\n",
+ "│ ❱ 515 │ │ raise KeyError(f\"Column {key} not in the dataset. Current columns in the dataset │\n",
+ "│ 516 │\n",
+ "│ 517 │\n",
+ "│ 518 def _check_valid_index_key(key: Union[int, slice, range, Iterable], size: int) -> None: │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "KeyError: \"Column test not in the dataset. Current columns in the dataset: ['label', 'title', 'content']\"\n",
+ "\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m87\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m84 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m85 \u001b[0m\u001b[2m# test\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m86 \u001b[0mdm = IMBDHSDataModule(model, tokenizer) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m87 dm.setup(\u001b[33m'\u001b[0m\u001b[33mtrain\u001b[0m\u001b[33m'\u001b[0m) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m88 \u001b[0mdl = dm.val_dataloader() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m89 \u001b[0mb = \u001b[96mnext\u001b[0m(\u001b[96miter\u001b[0m(dl)) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m90 \u001b[0mb \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92msetup\u001b[0m:\u001b[94m32\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m29 \u001b[0m\u001b[2m│ │ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m30 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[96mself\u001b[0m.dataset = load_dataset(\u001b[96mself\u001b[0m.hparams.dataset_name, split=\u001b[33m\"\u001b[0m\u001b[33mtest\u001b[0m\u001b[33m\"\u001b[0m) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m31 \u001b[0m\u001b[2m│ │ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m32 \u001b[2m│ │ \u001b[0mneg_hs, pos_hs, y, all_neg_ans, all_pos_ans = get_hidden_states_many_examples( \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m33 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[96mself\u001b[0m.model, \u001b[96mself\u001b[0m.tokenizer, \u001b[96mself\u001b[0m.dataset, \u001b[96mself\u001b[0m.hparams.model_type, n=\u001b[96mself\u001b[0m.hp \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m34 \u001b[0m\u001b[2m│ │ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m35 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[2m# let's create a simple 50/50 train split (the data is already randomized)\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92mget_hidden_states_many_examples\u001b[0m:\u001b[94m14\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m11 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m12 \u001b[0m\u001b[2m│ \u001b[0mres = [] \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m13 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m14 \u001b[2m│ \u001b[0mds_subset = data[\u001b[33m'\u001b[0m\u001b[33mtest\u001b[0m\u001b[33m'\u001b[0m].shuffle(\u001b[94m42\u001b[0m).select(\u001b[96mrange\u001b[0m(n)) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m15 \u001b[0m\u001b[2m│ \u001b[0mdl = DataLoader(ds_subset, batch_size=batch_size, shuffle=\u001b[94mTrue\u001b[0m) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m16 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mfor\u001b[0m batch \u001b[95min\u001b[0m tqdm(dl): \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m17 \u001b[0m\u001b[2m│ │ \u001b[0mtext, true_label = batch[\u001b[33m\"\u001b[0m\u001b[33mcontent\u001b[0m\u001b[33m\"\u001b[0m], batch[\u001b[33m\"\u001b[0m\u001b[33mlabel\u001b[0m\u001b[33m\"\u001b[0m] \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/\u001b[0m\u001b[1;33marrow_dataset.py\u001b[0m:\u001b[94m2778\u001b[0m in \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[92m__getitem__\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2775 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2776 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mdef\u001b[0m \u001b[92m__getitem__\u001b[0m(\u001b[96mself\u001b[0m, key): \u001b[2m# noqa: F811\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2777 \u001b[0m\u001b[2;90m│ │ \u001b[0m\u001b[33m\"\"\"Can be used to index columns (by string names) or rows (by integer index or i\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m2778 \u001b[2m│ │ \u001b[0m\u001b[94mreturn\u001b[0m \u001b[96mself\u001b[0m._getitem(key) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2779 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2780 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mdef\u001b[0m \u001b[92m__getitems__\u001b[0m(\u001b[96mself\u001b[0m, keys: List) -> List: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2781 \u001b[0m\u001b[2;90m│ │ \u001b[0m\u001b[33m\"\"\"Can be used to get a batch using a list of integers indices.\"\"\"\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/\u001b[0m\u001b[1;33marrow_dataset.py\u001b[0m:\u001b[94m2762\u001b[0m in \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[92m_getitem\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2759 \u001b[0m\u001b[2m│ │ \u001b[0mformat_kwargs = kwargs[\u001b[33m\"\u001b[0m\u001b[33mformat_kwargs\u001b[0m\u001b[33m\"\u001b[0m] \u001b[94mif\u001b[0m \u001b[33m\"\u001b[0m\u001b[33mformat_kwargs\u001b[0m\u001b[33m\"\u001b[0m \u001b[95min\u001b[0m kwargs \u001b[94melse\u001b[0m \u001b[96mself\u001b[0m._ \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2760 \u001b[0m\u001b[2m│ │ \u001b[0mformat_kwargs = format_kwargs \u001b[94mif\u001b[0m format_kwargs \u001b[95mis\u001b[0m \u001b[95mnot\u001b[0m \u001b[94mNone\u001b[0m \u001b[94melse\u001b[0m {} \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2761 \u001b[0m\u001b[2m│ │ \u001b[0mformatter = get_formatter(format_type, features=\u001b[96mself\u001b[0m._info.features, **format_kw \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m2762 \u001b[2m│ │ \u001b[0mpa_subtable = query_table(\u001b[96mself\u001b[0m._data, key, indices=\u001b[96mself\u001b[0m._indices \u001b[94mif\u001b[0m \u001b[96mself\u001b[0m._indice \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2763 \u001b[0m\u001b[2m│ │ \u001b[0mformatted_output = format_table( \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2764 \u001b[0m\u001b[2m│ │ │ \u001b[0mpa_subtable, key, formatter=formatter, format_columns=format_columns, output \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2765 \u001b[0m\u001b[2m│ │ \u001b[0m) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/formatting/\u001b[0m\u001b[1;33mformatting.py\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[94m575\u001b[0m in \u001b[92mquery_table\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m572 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mif\u001b[0m \u001b[95mnot\u001b[0m \u001b[96misinstance\u001b[0m(key, (\u001b[96mint\u001b[0m, \u001b[96mslice\u001b[0m, \u001b[96mrange\u001b[0m, \u001b[96mstr\u001b[0m, Iterable)): \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m573 \u001b[0m\u001b[2m│ │ \u001b[0m_raise_bad_key_type(key) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m574 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mif\u001b[0m \u001b[96misinstance\u001b[0m(key, \u001b[96mstr\u001b[0m): \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m575 \u001b[2m│ │ \u001b[0m_check_valid_column_key(key, table.column_names) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m576 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94melse\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m577 \u001b[0m\u001b[2m│ │ \u001b[0msize = indices.num_rows \u001b[94mif\u001b[0m indices \u001b[95mis\u001b[0m \u001b[95mnot\u001b[0m \u001b[94mNone\u001b[0m \u001b[94melse\u001b[0m table.num_rows \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m578 \u001b[0m\u001b[2m│ │ \u001b[0m_check_valid_index_key(key, size) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/datasets/formatting/\u001b[0m\u001b[1;33mformatting.py\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[94m515\u001b[0m in \u001b[92m_check_valid_column_key\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m512 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m513 \u001b[0m\u001b[94mdef\u001b[0m \u001b[92m_check_valid_column_key\u001b[0m(key: \u001b[96mstr\u001b[0m, columns: List[\u001b[96mstr\u001b[0m]) -> \u001b[94mNone\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m514 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mif\u001b[0m key \u001b[95mnot\u001b[0m \u001b[95min\u001b[0m columns: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m515 \u001b[2m│ │ \u001b[0m\u001b[94mraise\u001b[0m \u001b[96mKeyError\u001b[0m(\u001b[33mf\u001b[0m\u001b[33m\"\u001b[0m\u001b[33mColumn \u001b[0m\u001b[33m{\u001b[0mkey\u001b[33m}\u001b[0m\u001b[33m not in the dataset. Current columns in the dataset\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m516 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m517 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m518 \u001b[0m\u001b[94mdef\u001b[0m \u001b[92m_check_valid_index_key\u001b[0m(key: Union[\u001b[96mint\u001b[0m, \u001b[96mslice\u001b[0m, \u001b[96mrange\u001b[0m, Iterable], size: \u001b[96mint\u001b[0m) -> \u001b[94mNone\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mKeyError: \u001b[0m\u001b[32m\"Column test not in the dataset. Current columns in the dataset: \u001b[0m\u001b[32m[\u001b[0m\u001b[32m'label', 'title', 'content'\u001b[0m\u001b[32m]\u001b[0m\u001b[32m\"\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"\n",
"# def normalize(x):\n",
@@ -1483,14 +1604,40 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 30,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.647107Z",
- "start_time": "2023-05-20T01:57:03.647101Z"
+ "end_time": "2023-05-20T02:28:35.755617Z",
+ "start_time": "2023-05-20T02:28:35.755609Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:1 │\n",
+ "│ │\n",
+ "│ ❱ 1 dm.x_test.shape │\n",
+ "│ 2 │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "AttributeError: 'IMBDHSDataModule' object has no attribute 'x_test'\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m1\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m1 dm.x_test.shape \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mAttributeError: \u001b[0m\u001b[32m'IMBDHSDataModule'\u001b[0m object has no attribute \u001b[32m'x_test'\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"dm.x_test.shape"
]
@@ -1504,11 +1651,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 31,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.647739Z",
- "start_time": "2023-05-20T01:57:03.647733Z"
+ "end_time": "2023-05-20T02:28:35.756378Z",
+ "start_time": "2023-05-20T02:28:35.756365Z"
}
},
"outputs": [],
@@ -1518,11 +1665,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 32,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.648618Z",
- "start_time": "2023-05-20T01:57:03.648611Z"
+ "end_time": "2023-05-20T02:28:35.757039Z",
+ "start_time": "2023-05-20T02:28:35.757030Z"
}
},
"outputs": [],
@@ -1630,14 +1777,46 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 33,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.649120Z",
- "start_time": "2023-05-20T01:57:03.649114Z"
+ "end_time": "2023-05-20T02:28:35.757814Z",
+ "start_time": "2023-05-20T02:28:35.757806Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:3 │\n",
+ "│ │\n",
+ "│ 1 # init the autoencoder │\n",
+ "│ 2 max_epochs = 1000 │\n",
+ "│ ❱ 3 d = b[0].shape[-1] │\n",
+ "│ 4 net = CSS(d=d, max_epochs=max_epochs) │\n",
+ "│ 5 │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "NameError: name 'b' is not defined\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m3\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1 \u001b[0m\u001b[2m# init the autoencoder\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2 \u001b[0mmax_epochs = \u001b[94m1000\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m3 d = b[\u001b[94m0\u001b[0m].shape[-\u001b[94m1\u001b[0m] \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m4 \u001b[0mnet = CSS(d=d, max_epochs=max_epochs) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m5 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mNameError: \u001b[0mname \u001b[32m'b'\u001b[0m is not defined\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"# init the autoencoder\n",
"max_epochs = 1000\n",
@@ -1647,11 +1826,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 34,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.649727Z",
- "start_time": "2023-05-20T01:57:03.649721Z"
+ "end_time": "2023-05-20T02:28:35.758702Z",
+ "start_time": "2023-05-20T02:28:35.758693Z"
}
},
"outputs": [],
@@ -1661,15 +1840,57 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 35,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.650409Z",
- "start_time": "2023-05-20T01:57:03.650402Z"
+ "end_time": "2023-05-20T02:28:35.759285Z",
+ "start_time": "2023-05-20T02:28:35.759277Z"
},
"scrolled": true
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stderr",
+ "output_type": "stream",
+ "text": [
+ "GPU available: True (cuda), used: True\n",
+ "TPU available: False, using: 0 TPU cores\n",
+ "IPU available: False, using: 0 IPUs\n",
+ "HPU available: False, using: 0 HPUs\n",
+ "/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py:67: UserWarning: Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `lightning.pytorch` package, due to potential conflicts with other packages in the ML ecosystem. For this reason, `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard` or `tensorboardX` packages are found. Please `pip install lightning[extra]` or one of them to enable TensorBoard support by default\n",
+ " warning_cache.warn(\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:3 │\n",
+ "│ │\n",
+ "│ 1 # train the model (hint: here are some helpful Trainer arguments for rapid idea iteratio │\n",
+ "│ 2 trainer = pl.Trainer(limit_train_batches=100, max_epochs=max_epochs) │\n",
+ "│ ❱ 3 trainer.fit(model=net, datamodule=dm) │\n",
+ "│ 4 │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "NameError: name 'net' is not defined\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m3\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1 \u001b[0m\u001b[2m# train the model (hint: here are some helpful Trainer arguments for rapid idea iteratio\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2 \u001b[0mtrainer = pl.Trainer(limit_train_batches=\u001b[94m100\u001b[0m, max_epochs=max_epochs) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m3 trainer.fit(model=net, datamodule=dm) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m4 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mNameError: \u001b[0mname \u001b[32m'net'\u001b[0m is not defined\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"# train the model (hint: here are some helpful Trainer arguments for rapid idea iteration)\n",
"trainer = pl.Trainer(limit_train_batches=100, max_epochs=max_epochs)\n",
@@ -1678,14 +1899,26 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 36,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.650895Z",
- "start_time": "2023-05-20T01:57:03.650889Z"
+ "end_time": "2023-05-20T02:28:35.760108Z",
+ "start_time": "2023-05-20T02:28:35.760100Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "> \u001b[0;32m/tmp/ipykernel_3455549/4111709629.py\u001b[0m(3)\u001b[0;36m\u001b[0;34m()\u001b[0m\n",
+ "\u001b[0;32m 1 \u001b[0;31m\u001b[0;31m# train the model (hint: here are some helpful Trainer arguments for rapid idea iteration)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0m\u001b[0;32m 2 \u001b[0;31m\u001b[0mtrainer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mpl\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTrainer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlimit_train_batches\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m100\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmax_epochs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmax_epochs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0m\u001b[0;32m----> 3 \u001b[0;31m\u001b[0mtrainer\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmodel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnet\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatamodule\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdm\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
+ "\u001b[0m\n"
+ ]
+ }
+ ],
"source": [
"%debug"
]
@@ -1704,11 +1937,11 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 37,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.651740Z",
- "start_time": "2023-05-20T01:57:03.651734Z"
+ "end_time": "2023-05-20T02:28:35.760833Z",
+ "start_time": "2023-05-20T02:28:35.760825Z"
}
},
"outputs": [],
@@ -1741,14 +1974,219 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 38,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.652269Z",
- "start_time": "2023-05-20T01:57:03.652263Z"
+ "end_time": "2023-05-20T02:28:35.761623Z",
+ "start_time": "2023-05-20T02:28:35.761614Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "[]\n"
+ ]
+ },
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:1 │\n",
+ "│ │\n",
+ "│ ❱ 1 df_hist = read_hist(trainer).ffill().bfill() │\n",
+ "│ 2 df_hist │\n",
+ "│ 3 │\n",
+ "│ │\n",
+ "│ in read_hist:23 │\n",
+ "│ │\n",
+ "│ 20 │ │ df_histe = read_metrics_csv(metrics_file_path) │\n",
+ "│ 21 │ │ return df_histe │\n",
+ "│ 22 │ except Exception as e: │\n",
+ "│ ❱ 23 │ │ raise e │\n",
+ "│ 24 │ │ print(e) │\n",
+ "│ 25 │\n",
+ "│ │\n",
+ "│ in read_hist:20 │\n",
+ "│ │\n",
+ "│ 17 │ print(ts) │\n",
+ "│ 18 │ try: │\n",
+ "│ 19 │ │ metrics_file_path = Path(ts[0].experiment.metrics_file_path) │\n",
+ "│ ❱ 20 │ │ df_histe = read_metrics_csv(metrics_file_path) │\n",
+ "│ 21 │ │ return df_histe │\n",
+ "│ 22 │ except Exception as e: │\n",
+ "│ 23 │ │ raise e │\n",
+ "│ │\n",
+ "│ in read_metrics_csv:8 │\n",
+ "│ │\n",
+ "│ 5 import pandas as pd │\n",
+ "│ 6 │\n",
+ "│ 7 def read_metrics_csv(metrics_file_path): │\n",
+ "│ ❱ 8 │ df_hist = pd.read_csv(metrics_file_path) │\n",
+ "│ 9 │ df_hist[\"epoch\"] = df_hist[\"epoch\"].ffill() │\n",
+ "│ 10 │ df_histe = df_hist.set_index(\"epoch\").groupby(\"epoch\").mean() │\n",
+ "│ 11 │ return df_histe │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/readers.py:912 │\n",
+ "│ in read_csv │\n",
+ "│ │\n",
+ "│ 909 │ ) │\n",
+ "│ 910 │ kwds.update(kwds_defaults) │\n",
+ "│ 911 │ │\n",
+ "│ ❱ 912 │ return _read(filepath_or_buffer, kwds) │\n",
+ "│ 913 │\n",
+ "│ 914 │\n",
+ "│ 915 # iterator=True -> TextFileReader │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/readers.py:577 │\n",
+ "│ in _read │\n",
+ "│ │\n",
+ "│ 574 │ _validate_names(kwds.get(\"names\", None)) │\n",
+ "│ 575 │ │\n",
+ "│ 576 │ # Create the parser. │\n",
+ "│ ❱ 577 │ parser = TextFileReader(filepath_or_buffer, **kwds) │\n",
+ "│ 578 │ │\n",
+ "│ 579 │ if chunksize or iterator: │\n",
+ "│ 580 │ │ return parser │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/readers.py:1407 │\n",
+ "│ in __init__ │\n",
+ "│ │\n",
+ "│ 1404 │ │ │ self.options[\"has_index_names\"] = kwds[\"has_index_names\"] │\n",
+ "│ 1405 │ │ │\n",
+ "│ 1406 │ │ self.handles: IOHandles | None = None │\n",
+ "│ ❱ 1407 │ │ self._engine = self._make_engine(f, self.engine) │\n",
+ "│ 1408 │ │\n",
+ "│ 1409 │ def close(self) -> None: │\n",
+ "│ 1410 │ │ if self.handles is not None: │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/readers.py:1661 │\n",
+ "│ in _make_engine │\n",
+ "│ │\n",
+ "│ 1658 │ │ │ │ is_text = False │\n",
+ "│ 1659 │ │ │ │ if \"b\" not in mode: │\n",
+ "│ 1660 │ │ │ │ │ mode += \"b\" │\n",
+ "│ ❱ 1661 │ │ │ self.handles = get_handle( │\n",
+ "│ 1662 │ │ │ │ f, │\n",
+ "│ 1663 │ │ │ │ mode, │\n",
+ "│ 1664 │ │ │ │ encoding=self.options.get(\"encoding\", None), │\n",
+ "│ │\n",
+ "│ /home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/common.py:859 in │\n",
+ "│ get_handle │\n",
+ "│ │\n",
+ "│ 856 │ │ # Binary mode does not support 'encoding' and 'newline'. │\n",
+ "│ 857 │ │ if ioargs.encoding and \"b\" not in ioargs.mode: │\n",
+ "│ 858 │ │ │ # Encoding │\n",
+ "│ ❱ 859 │ │ │ handle = open( │\n",
+ "│ 860 │ │ │ │ handle, │\n",
+ "│ 861 │ │ │ │ ioargs.mode, │\n",
+ "│ 862 │ │ │ │ encoding=ioargs.encoding, │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "FileNotFoundError: [Errno 2] No such file or directory: \n",
+ "'/home/ubuntu/Documents/mjc/elk/discovering_latent_knowledge/lightning_logs/version_4/metrics.csv'\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m1\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m1 df_hist = read_hist(trainer).ffill().bfill() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2 \u001b[0mdf_hist \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m3 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92mread_hist\u001b[0m:\u001b[94m23\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m20 \u001b[0m\u001b[2m│ │ \u001b[0mdf_histe = read_metrics_csv(metrics_file_path) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m21 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mreturn\u001b[0m df_histe \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m22 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mexcept\u001b[0m \u001b[96mException\u001b[0m \u001b[94mas\u001b[0m e: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m23 \u001b[2m│ │ \u001b[0m\u001b[94mraise\u001b[0m e \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m24 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[96mprint\u001b[0m(e) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m25 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92mread_hist\u001b[0m:\u001b[94m20\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m17 \u001b[0m\u001b[2m│ \u001b[0m\u001b[96mprint\u001b[0m(ts) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m18 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mtry\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m19 \u001b[0m\u001b[2m│ │ \u001b[0mmetrics_file_path = Path(ts[\u001b[94m0\u001b[0m].experiment.metrics_file_path) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m20 \u001b[2m│ │ \u001b[0mdf_histe = read_metrics_csv(metrics_file_path) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m21 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mreturn\u001b[0m df_histe \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m22 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mexcept\u001b[0m \u001b[96mException\u001b[0m \u001b[94mas\u001b[0m e: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m23 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mraise\u001b[0m e \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92mread_metrics_csv\u001b[0m:\u001b[94m8\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 5 \u001b[0m\u001b[94mimport\u001b[0m \u001b[4;96mpandas\u001b[0m \u001b[94mas\u001b[0m \u001b[4;96mpd\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 6 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 7 \u001b[0m\u001b[94mdef\u001b[0m \u001b[92mread_metrics_csv\u001b[0m(metrics_file_path): \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 8 \u001b[2m│ \u001b[0mdf_hist = pd.read_csv(metrics_file_path) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 9 \u001b[0m\u001b[2m│ \u001b[0mdf_hist[\u001b[33m\"\u001b[0m\u001b[33mepoch\u001b[0m\u001b[33m\"\u001b[0m] = df_hist[\u001b[33m\"\u001b[0m\u001b[33mepoch\u001b[0m\u001b[33m\"\u001b[0m].ffill() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m10 \u001b[0m\u001b[2m│ \u001b[0mdf_histe = df_hist.set_index(\u001b[33m\"\u001b[0m\u001b[33mepoch\u001b[0m\u001b[33m\"\u001b[0m).groupby(\u001b[33m\"\u001b[0m\u001b[33mepoch\u001b[0m\u001b[33m\"\u001b[0m).mean() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m11 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mreturn\u001b[0m df_histe \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/\u001b[0m\u001b[1;33mreaders.py\u001b[0m:\u001b[94m912\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92mread_csv\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 909 \u001b[0m\u001b[2m│ \u001b[0m) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 910 \u001b[0m\u001b[2m│ \u001b[0mkwds.update(kwds_defaults) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 911 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 912 \u001b[2m│ \u001b[0m\u001b[94mreturn\u001b[0m _read(filepath_or_buffer, kwds) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 913 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 914 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 915 \u001b[0m\u001b[2m# iterator=True -> TextFileReader\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/\u001b[0m\u001b[1;33mreaders.py\u001b[0m:\u001b[94m577\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m_read\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 574 \u001b[0m\u001b[2m│ \u001b[0m_validate_names(kwds.get(\u001b[33m\"\u001b[0m\u001b[33mnames\u001b[0m\u001b[33m\"\u001b[0m, \u001b[94mNone\u001b[0m)) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 575 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 576 \u001b[0m\u001b[2m│ \u001b[0m\u001b[2m# Create the parser.\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 577 \u001b[2m│ \u001b[0mparser = TextFileReader(filepath_or_buffer, **kwds) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 578 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 579 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mif\u001b[0m chunksize \u001b[95mor\u001b[0m iterator: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 580 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mreturn\u001b[0m parser \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/\u001b[0m\u001b[1;33mreaders.py\u001b[0m:\u001b[94m1407\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m__init__\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1404 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[96mself\u001b[0m.options[\u001b[33m\"\u001b[0m\u001b[33mhas_index_names\u001b[0m\u001b[33m\"\u001b[0m] = kwds[\u001b[33m\"\u001b[0m\u001b[33mhas_index_names\u001b[0m\u001b[33m\"\u001b[0m] \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1405 \u001b[0m\u001b[2m│ │ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1406 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[96mself\u001b[0m.handles: IOHandles | \u001b[94mNone\u001b[0m = \u001b[94mNone\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m1407 \u001b[2m│ │ \u001b[0m\u001b[96mself\u001b[0m._engine = \u001b[96mself\u001b[0m._make_engine(f, \u001b[96mself\u001b[0m.engine) \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1408 \u001b[0m\u001b[2m│ \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1409 \u001b[0m\u001b[2m│ \u001b[0m\u001b[94mdef\u001b[0m \u001b[92mclose\u001b[0m(\u001b[96mself\u001b[0m) -> \u001b[94mNone\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1410 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mif\u001b[0m \u001b[96mself\u001b[0m.handles \u001b[95mis\u001b[0m \u001b[95mnot\u001b[0m \u001b[94mNone\u001b[0m: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/parsers/\u001b[0m\u001b[1;33mreaders.py\u001b[0m:\u001b[94m1661\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m_make_engine\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1658 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mis_text = \u001b[94mFalse\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1659 \u001b[0m\u001b[2m│ │ │ │ \u001b[0m\u001b[94mif\u001b[0m \u001b[33m\"\u001b[0m\u001b[33mb\u001b[0m\u001b[33m\"\u001b[0m \u001b[95mnot\u001b[0m \u001b[95min\u001b[0m mode: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1660 \u001b[0m\u001b[2m│ │ │ │ │ \u001b[0mmode += \u001b[33m\"\u001b[0m\u001b[33mb\u001b[0m\u001b[33m\"\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m1661 \u001b[2m│ │ │ \u001b[0m\u001b[96mself\u001b[0m.handles = get_handle( \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1662 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mf, \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1663 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mmode, \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m1664 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mencoding=\u001b[96mself\u001b[0m.options.get(\u001b[33m\"\u001b[0m\u001b[33mencoding\u001b[0m\u001b[33m\"\u001b[0m, \u001b[94mNone\u001b[0m), \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2;33m/home/ubuntu/mambaforge/envs/dlk2/lib/python3.9/site-packages/pandas/io/\u001b[0m\u001b[1;33mcommon.py\u001b[0m:\u001b[94m859\u001b[0m in \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[92mget_handle\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 856 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[2m# Binary mode does not support 'encoding' and 'newline'.\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 857 \u001b[0m\u001b[2m│ │ \u001b[0m\u001b[94mif\u001b[0m ioargs.encoding \u001b[95mand\u001b[0m \u001b[33m\"\u001b[0m\u001b[33mb\u001b[0m\u001b[33m\"\u001b[0m \u001b[95mnot\u001b[0m \u001b[95min\u001b[0m ioargs.mode: \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 858 \u001b[0m\u001b[2m│ │ │ \u001b[0m\u001b[2m# Encoding\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m 859 \u001b[2m│ │ │ \u001b[0mhandle = \u001b[96mopen\u001b[0m( \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 860 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mhandle, \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 861 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mioargs.mode, \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m 862 \u001b[0m\u001b[2m│ │ │ │ \u001b[0mencoding=ioargs.encoding, \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mFileNotFoundError: \u001b[0m\u001b[1m[\u001b[0mErrno \u001b[1;36m2\u001b[0m\u001b[1m]\u001b[0m No such file or directory: \n",
+ "\u001b[32m'/home/ubuntu/Documents/mjc/elk/discovering_latent_knowledge/lightning_logs/version_4/metrics.csv'\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"df_hist = read_hist(trainer).ffill().bfill()\n",
"df_hist"
@@ -1756,14 +2194,44 @@
},
{
"cell_type": "code",
- "execution_count": null,
+ "execution_count": 39,
"metadata": {
"ExecuteTime": {
- "end_time": "2023-05-20T01:57:03.653040Z",
- "start_time": "2023-05-20T01:57:03.653033Z"
+ "end_time": "2023-05-20T02:28:35.762326Z",
+ "start_time": "2023-05-20T02:28:35.762318Z"
}
},
- "outputs": [],
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮\n",
+ "│ in <module>:1 │\n",
+ "│ │\n",
+ "│ ❱ 1 df_hist[['val/acc', 'train/acc']].plot() │\n",
+ "│ 2 │\n",
+ "│ 3 df_hist[['val/f1', 'train/f1']].plot() │\n",
+ "│ 4 │\n",
+ "╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
+ "NameError: name 'df_hist' is not defined\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[31m╭─\u001b[0m\u001b[31m──────────────────────────────\u001b[0m\u001b[31m \u001b[0m\u001b[1;31mTraceback \u001b[0m\u001b[1;2;31m(most recent call last)\u001b[0m\u001b[31m \u001b[0m\u001b[31m───────────────────────────────\u001b[0m\u001b[31m─╮\u001b[0m\n",
+ "\u001b[31m│\u001b[0m in \u001b[92m\u001b[0m:\u001b[94m1\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[31m❱ \u001b[0m1 df_hist[[\u001b[33m'\u001b[0m\u001b[33mval/acc\u001b[0m\u001b[33m'\u001b[0m, \u001b[33m'\u001b[0m\u001b[33mtrain/acc\u001b[0m\u001b[33m'\u001b[0m]].plot() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m2 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m3 \u001b[0mdf_hist[[\u001b[33m'\u001b[0m\u001b[33mval/f1\u001b[0m\u001b[33m'\u001b[0m, \u001b[33m'\u001b[0m\u001b[33mtrain/f1\u001b[0m\u001b[33m'\u001b[0m]].plot() \u001b[31m│\u001b[0m\n",
+ "\u001b[31m│\u001b[0m \u001b[2m4 \u001b[0m \u001b[31m│\u001b[0m\n",
+ "\u001b[31m╰──────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n",
+ "\u001b[1;91mNameError: \u001b[0mname \u001b[32m'df_hist'\u001b[0m is not defined\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ }
+ ],
"source": [
"df_hist[['val/acc', 'train/acc']].plot()\n",
"\n",
@@ -1812,7 +2280,7 @@
"kernelspec": {
"display_name": "dlk2",
"language": "python",
- "name": "dlk2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
@@ -1843,11 +2311,6 @@
},
"toc_section_display": true,
"toc_window_display": true
- },
- "vscode": {
- "interpreter": {
- "hash": "b80286374679f2ad472c61c83fc267d31329b5dea8e2dcaccb727123767724c5"
- }
}
},
"nbformat": 4,
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
index acb154d..d09f7c8 100644
--- a/requirements/requirements.txt
+++ b/requirements/requirements.txt
@@ -7,3 +7,5 @@ scikit-learn
accelerate
bitsandbytes
lightning
+peft
+sentencepiece