{ "nbformat": 4, "nbformat_minor": 0, "metadata": { "kernelspec": { "display_name": "TensorFlow 2.3 on Python 3.6 (CUDA 10.1)", "language": "python", "name": "python3" }, "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.6.9" }, "colab": { "name": "6-1.sigmoid_function.ipynb", "provenance": [] } }, "cells": [ { "cell_type": "markdown", "metadata": { "id": "oXsz2JFUw_Nq" }, "source": [ "# 시그모이드 활성화 함수" ] }, { "cell_type": "markdown", "metadata": { "id": "wiP3O4uuw_Nr" }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/rickiepark/dl-illustrated/blob/master/notebooks/6-1.sigmoid_function.ipynb)" ] }, { "cell_type": "code", "metadata": { "id": "Mw4kUI2Ow_Ns" }, "source": [ "from math import e" ], "execution_count": 1, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "2u7mQgEHw_Ns" }, "source": [ "def sigmoid(z):\n", " return 1/(1+e**-z)" ], "execution_count": 2, "outputs": [] }, { "cell_type": "code", "metadata": { "id": "pBoFXStpw_Ns", "outputId": "385ae9cc-5559-421f-9b33-a889d9fd4100", "colab": { "base_uri": "https://localhost:8080/" } }, "source": [ "sigmoid(.00001)" ], "execution_count": 3, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "0.5000024999999999" ] }, "metadata": {}, "execution_count": 3 } ] }, { "cell_type": "code", "metadata": { "id": "RsGW7IXqw_Nt", "outputId": "03912a03-8f7e-443f-e829-b3946668c588", "colab": { "base_uri": "https://localhost:8080/" } }, "source": [ "sigmoid(10000)" ], "execution_count": 4, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "1.0" ] }, "metadata": {}, "execution_count": 4 } ] }, { "cell_type": "code", "metadata": { "id": "J7qiDVKjw_Nt", "outputId": "1752c51a-69bb-4c41-820a-967b69700bb5", "colab": { "base_uri": "https://localhost:8080/" } }, "source": [ "sigmoid(-1)" ], "execution_count": 5, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "0.2689414213699951" ] }, "metadata": {}, "execution_count": 5 } ] }, { "cell_type": "code", "metadata": { "id": "G9CubnUzw_Nu", "outputId": "3f80ac8b-5ccb-4d53-fca3-4c00f36c3414", "colab": { "base_uri": "https://localhost:8080/" } }, "source": [ "sigmoid(-10)" ], "execution_count": 6, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "4.539786870243442e-05" ] }, "metadata": {}, "execution_count": 6 } ] }, { "cell_type": "code", "metadata": { "id": "lR2AsZFsw_Nu", "outputId": "730b83ba-9c3a-4e00-e19d-d9f316952805", "colab": { "base_uri": "https://localhost:8080/" } }, "source": [ "sigmoid(-2.0)" ], "execution_count": 7, "outputs": [ { "output_type": "execute_result", "data": { "text/plain": [ "0.11920292202211757" ] }, "metadata": {}, "execution_count": 7 } ] } ] }