Skip to content

Commit

Permalink
Typo fix and constructor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
calebrob6 committed Feb 23, 2024
1 parent 94f3d82 commit 1c38a6f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
23 changes: 12 additions & 11 deletions docs/tutorials/custom_segmentation_trainer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {},
"source": [
"flake8: noqa: E501\n",
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
"\n",
"Copyright (c) Microsoft Corporation. All rights reserved.\n",
"Licensed under the MIT License."
]
},
Expand Down Expand Up @@ -52,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -63,7 +63,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"id": "0b01bf43",
"metadata": {},
"outputs": [],
Expand All @@ -86,7 +86,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "3e721f3f",
"metadata": {},
"outputs": [],
Expand All @@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "7fb5fbbf",
"metadata": {
"lines_to_end_of_cell_marker": 2
Expand Down Expand Up @@ -128,15 +128,16 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"metadata": {},
"outputs": [],
"source": [
"class CustomSemanticSegmentationTask(SemanticSegmentationTask):\n",
"\n",
" # any keywords we add here between *args and **kwargs will be found in self.hparams\n",
" def __init__(self, *args, tmax=50, eta_min=1e-6, **kwargs) -> None:\n",
" del kwargs[\"ignore\"] # this is a hack\n",
" if \"ignore\" in kwargs:\n",
" del kwargs[\"ignore\"] # this is a hack\n",
" super().__init__(*args, **kwargs) # pass args and kwargs to the parent class\n",
"\n",
" def configure_optimizers(\n",
Expand Down Expand Up @@ -215,7 +216,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -224,7 +225,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -242,7 +243,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -265,7 +266,7 @@
"\"tmax\": 50"
]
},
"execution_count": 6,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
5 changes: 3 additions & 2 deletions docs/tutorials/custom_segmentation_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
# ---

# flake8: noqa: E501
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

# # Custom Trainers
Expand Down Expand Up @@ -81,7 +81,8 @@ class CustomSemanticSegmentationTask(SemanticSegmentationTask):

# any keywords we add here between *args and **kwargs will be found in self.hparams
def __init__(self, *args, tmax=50, eta_min=1e-6, **kwargs) -> None:
del kwargs["ignore"] # this is a hack
if "ignore" in kwargs:
del kwargs["ignore"] # this is a hack
super().__init__(*args, **kwargs) # pass args and kwargs to the parent class

def configure_optimizers(
Expand Down

0 comments on commit 1c38a6f

Please sign in to comment.