Deep learning / softmax function

1.First of all

This time, I will briefly summarize the softmax function.

2. What is a softmax function?

Converts the output of the neural network to a total probability of 1. スクリーンショット 2020-03-28 16.31.12.png

3. Specific calculation

If the output $ y_1 $ ~ $ y_3 $ is as follows,

スクリーンショット 2020-03-28 16.32.54.png The result through the softmax function is スクリーンショット 2020-03-28 16.25.28.png

4. Code

import numpy as np

def softmax(z):
    y = np.exp(z) / np.sum(np.exp(z))
    return y

z = np.array([1.2,  0.8,  0.3])
answer = softmax(z)
print(answer)

#output
# [0.48148922  0.32275187  0.19575891]

Recommended Posts

Deep learning / softmax function
Introduction to Deep Learning ~ Function Approximation ~
Deep Learning Memorandum
Start Deep learning
Python Deep Learning
Deep learning × Python
Summary Note on Deep Learning -4.2 Loss Function-
First Deep Learning ~ Struggle ~
Chainer and deep learning learned by function approximation
Python: Deep Learning Practices
Deep learning / activation functions
Deep Learning from scratch
Deep learning / error back propagation of sigmoid function
Deep learning / cross entropy
First Deep Learning ~ Preparation ~
[AI] Deep Metric Learning
Introduction to Deep Learning ~ Localization and Loss Function ~
Python: Deep Learning Tuning
[Deep Learning from scratch] Layer implementation from softmax function to cross entropy error
Why Deep Metric Learning based on Softmax functions works
Deep Learning from scratch 1-3 chapters
Try deep learning with TensorFlow
Deep Learning Gaiden ~ GPU Programming ~
<Course> Deep Learning: Day2 CNN
Deep learning image recognition 1 theory
Deep running 2 Tuning of deep learning
Deep learning / LSTM scratch code
Rabbit Challenge Deep Learning 1Day
<Course> Deep Learning: Day1 NN
Deep Kernel Learning with Pyro
Try Deep Learning with FPGA
Deep learning for compound formation?
Introducing Udacity Deep Learning Nanodegree
Subjects> Deep Learning: Day3 RNN
Introduction to Deep Learning ~ Learning Rules ~
Rabbit Challenge Deep Learning 2Day
Deep Reinforcement Learning 1 Introduction to Reinforcement Learning
Zura with softmax function implemented
Deep reinforcement learning 2 Implementation of reinforcement learning
Generate Pokemon with Deep Learning
Introduction to Deep Learning ~ Backpropagation ~
Deep Learning Model Lightening Library Distiller
Deep Learning / Deep Learning from Zero 2 Chapter 4 Memo
Try Deep Learning with FPGA-Select Cucumbers
Cat breed identification with deep learning
Deep Learning / Deep Learning from Zero Chapter 3 Memo
Make ASCII art with deep learning
Deep Learning / Deep Learning from Zero 2 Chapter 5 Memo
Implement Deep Learning / VAE (Variational Autoencoder)
Try deep learning with TensorFlow Part 2
About Deep Learning (DNN) Project Management
Solve three-dimensional PDEs with deep learning.
Introduction to Deep Learning ~ Coding Preparation ~
Organize machine learning and deep learning platforms
Deep learning learned by implementation 1 (regression)
Deep Learning / Deep Learning from Zero 2 Chapter 7 Memo
Deep Learning / Deep Learning from Zero 2 Chapter 8 Memo
Microsoft's Deep Learning Library "CNTK" Tutorial
Check squat forms with deep learning
Deep Learning / Deep Learning from Zero Chapter 4 Memo
Deep Reinforcement Learning 3 Practical Edition: Breakout