当前位置:网站首页>Keras II classification problem
Keras II classification problem
2022-07-23 18:00:00 【Rong_ Gong】
Keras Second, classification problem
One 、Keras Development Overview
Keras The model mainly includes the following steps :
(1) Define training data : Input tensor and target tensor .
(2) Define the composition network of the layer ( The model ), Map input to target .
(3) Configure learning process : Choose the loss function 、 Optimizer and indicators to monitor .
(4) Calling the model fit Methods we iterated on the training data .
Two 、 The classification of film reviews ( Dichotomous problem )
1. Data sets :IMDB Data sets ( For an introduction to this dataset, see here )
2. Hot coding alone (one-hot code ) For an introduction to this code, see REF1、REF2、REF3、REF4.
3.one-hot For the purpose of coding, see The only hot coding in data preprocessing (One-Hot): Why use one-hot code ?
The following text is excerpted from The only hot coding in data preprocessing (One-Hot): Why use one-hot code ?: Use one-hot The direct reason for this is that nowadays there are many classifications cnn The output of the network is generally softmax layer , And its output is a probability distribution , Thus, the labels required to be input also appear in the form of probability distribution , Then calculate the cross entropy and so on .one-hot In fact, it gives the real probability distribution of the real sample , The probability of one sample data is 1, The rest are all 0.. When calculating the loss cross entropy , Direct use 1*log(1/ probability ), The cross entropy is directly calculated , As a loss .
3、 ... and 、 The code is as follows





边栏推荐
猜你喜欢

分析optimism重放合约地址攻击事件

@Will multiple bean instances be created by multiple method calls of bean annotations

Research and implementation of network multi exit design based on policy routing deployment

MySQL六十六问,两万字+五十图详解含(答案解析)

Analyze optimism replay contract address attack events

训练和测试的loss不下降,并且精度超低

rust中的静态分发和动态分发

TYPE-C 转OTG(USB2.0传输数据)+PD充电协议芯片 乐得瑞LDR6028/LDR6023SS

Trust guessing numbers game

leetcode刷题:动态规划05(不同路径 II)
随机推荐
Interviewer: how to use redis to realize distributed locks?
(十一)STM32——IO引脚复用与映射
docker安装redis并以配置文件方式启动
Mysql操作
TYPE-C 转OTG(USB2.0传输数据)+PD充电协议芯片 乐得瑞LDR6028/LDR6023SS
MySQL六十六问,两万字+五十图详解含(答案解析)
为什么香港服务器可以免备案
curl命令详解[通俗易懂]
卷积核越大性能越强?一文解读RepLKNet模型
From 5 seconds to 1 second, remember the performance optimization with "very" significant effect once
Do you really understand the persistence mechanism of redis?
rust求两数之和
Trust finds the maximum value in the array
ContextLoaderListener vs DispatcherServlet
封玩家IP和机器码以及解开被封的教程
@Will multiple bean instances be created by multiple method calls of bean annotations
TwinCAT 3 first run error 4115
分析optimism重放合约地址攻击事件
rust猜数字游戏
使用moment获取当天日期与下一天