22-T67/multi-task-learning.ipynb

69 lines
1.6 KiB
Plaintext

{
"cells": [
{
"cell_type": "markdown",
"id": "30222419-bfdf-4c4b-ada1-5aafbf27bc88",
"metadata": {},
"source": [
"按照图示完成多任务学习的网络结构,部分网络层共享参数"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "573727b3-ebeb-4a34-ad53-7596363052fe",
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/zhaojh/miniconda3/envs/py37/lib/python3.7/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"source": [
"import torch\n",
"from torch import nn"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8d08f996-b93e-4e42-a889-b85aa438f4df",
"metadata": {},
"outputs": [],
"source": [
"class MTLNN(nn.Module):\n",
" def __init__(self):\n",
" super(MTLNN, self).__init__()\n",
" self.main_branch = nn.Sequential(\n",
" nn.\n",
" )"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "py37",
"language": "python",
"name": "py37"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}