{
"cells": [
{
"cell_type": "markdown",
"id": "b9dcaba2",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"# 多层感知机\n",
"\n",
"简要介绍一些常见的激活函数"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "5fe77ef0",
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-18T06:56:49.792151Z",
"iopub.status.busy": "2023-08-18T06:56:49.791335Z",
"iopub.status.idle": "2023-08-18T06:56:51.817055Z",
"shell.execute_reply": "2023-08-18T06:56:51.816151Z"
},
"origin_pos": 2,
"tab": [
"pytorch"
]
},
"outputs": [],
"source": [
"%matplotlib inline\n",
"import torch\n",
"from d2l import torch as d2l"
]
},
{
"cell_type": "markdown",
"id": "785aeacf",
"metadata": {
"slideshow": {
"slide_type": "slide"
}
},
"source": [
"ReLU提供了一种非常简单的非线性变换\n",
"$$\\operatorname{ReLU}(x) = \\max(x, 0)$$"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "e5c9d313",
"metadata": {
"execution": {
"iopub.execute_input": "2023-08-18T06:56:51.821221Z",
"iopub.status.busy": "2023-08-18T06:56:51.820525Z",
"iopub.status.idle": "2023-08-18T06:56:52.021660Z",
"shell.execute_reply": "2023-08-18T06:56:52.020787Z"
},
"origin_pos": 7,
"tab": [
"pytorch"
]
},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n"
],
"text/plain": [
"