当前位置: 首页 > news >正文

重庆学校网站推广网站模块图片尺寸

重庆学校网站推广,网站模块图片尺寸,光伏电站建设的国家网站,wordpress 留言簿Intro 这是深度学习第7课。 到目前为止#xff0c;您构建的模型依赖于预先训练的模型。 但它们不是许多用例的理想解决方案。 在本课程中#xff0c;您将学习如何构建全新的模型。 Lesson [1] from IPython.display import YouTubeVideo YouTubeVideo(YbNE3zhtsoo, widt…Intro 这是深度学习第7课。 到目前为止您构建的模型依赖于预先训练的模型。 但它们不是许多用例的理想解决方案。 在本课程中您将学习如何构建全新的模型。 Lesson [1] from IPython.display import YouTubeVideo YouTubeVideo(YbNE3zhtsoo, width800, height450) Sample Code [2] import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from tensorflow.python import keras from tensorflow.python.keras.models import Sequential from tensorflow.python.keras.layers import Dense, Flatten, Conv2D, Dropoutimg_rows, img_cols 28, 28 num_classes 10def data_prep(raw):out_y keras.utils.to_categorical(raw.label, num_classes)num_images raw.shape[0]x_as_array raw.values[:,1:]x_shaped_array x_as_array.reshape(num_images, img_rows, img_cols, 1)out_x x_shaped_array / 255return out_x, out_ytrain_file ../input/digit-recognizer/train.csv raw_data pd.read_csv(train_file)x, y data_prep(raw_data)model Sequential() model.add(Conv2D(20, kernel_size(3, 3),activationrelu,input_shape(img_rows, img_cols, 1))) model.add(Conv2D(20, kernel_size(3, 3), activationrelu)) model.add(Flatten()) model.add(Dense(128, activationrelu)) model.add(Dense(num_classes, activationsoftmax))model.compile(losskeras.losses.categorical_crossentropy,optimizeradam,metrics[accuracy]) model.fit(x, y,batch_size128,epochs2,validation_split 0.2) /opt/conda/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 np.dtype(float).type.from ._conv import register_converters as _register_convertersTrain on 33600 samples, validate on 8400 samples Epoch 1/2 33600/33600 [] - 56s 2ms/step - loss: 0.2454 - acc: 0.9292 - val_loss: 0.0823 - val_acc: 0.9749 Epoch 2/2 33600/33600 [] - 58s 2ms/step - loss: 0.0650 - acc: 0.9810 - val_loss: 0.0590 - val_acc: 0.9820tensorflow.python.keras._impl.keras.callbacks.History at 0x7fa843394978 Exercise: Modeling from Scratch Introduction 您已经了解了如何从头开始构建模型以识别手写数字。 您现在将构建一个模型来识别不同类型的服装。 为了制作快速训练的模型我们将使用非常小低分辨率的图像。 例如您的模型将采用这样的图像并将其识别为鞋子 Data Preparation 代码如下您不需要去修改他运行一下代码。 【3】 import numpy as np from sklearn.model_selection import train_test_split from tensorflow.python import kerasimg_rows, img_cols 28, 28 num_classes 10def prep_data(raw, train_size, val_size):y raw[:, 0]out_y keras.utils.to_categorical(y, num_classes)x raw[:,1:]num_images raw.shape[0]out_x x.reshape(num_images, img_rows, img_cols, 1)out_x out_x / 255return out_x, out_yfashion_file ../input/fashionmnist/fashion-mnist_train.csv fashion_data np.loadtxt(fashion_file, skiprows1, delimiter,) x, y prep_data(fashion_data, train_size50000, val_size5000) Specify Model STEPS: 创建顺序模型。 称之为fashion_model。 将3个Conv2D图层添加到fashion_model。 使每个层有12个过滤器kernel_size为3和relu激活。 您需要为第一个Conv2D图层指定input_shape。 在这种情况下输入形状是img_rowsimg_cols1。在最后一个Conv2D图层之后将fashionten图层添加到fashion_model。 在Flatten图层之后将具有100个神经元的Dense图层添加到fashion_model。将预测图层添加到fashion_model。 这是一个密集层。 我们已经有一个名为num_classes的变量。 指定此层中的节点数时请使用此变量。 激活应该是softmax或者你以后会遇到问题。 【4】 from tensorflow.python import keras from tensorflow.python.keras.models import Sequential from tensorflow.python.keras.layers import Dense, Flatten, Conv2D# Your Code Here Compile Model 运行命令fashion_model.compile。指定以下参数 loss keras.losses.categorical_crossentropyoptimizer adammetrics [accuracy] 【5】 # Your code to compile the model in this cell Fit Model 运行命令fashion_model.fit。你将会用到的参数有 The first two are arguments are the data used to fit the model, which are x and y respectively.batch_size 100epochs 4validation_split 0.2 当你运行此命令时你会看到你的模型正在改善您将看到验证的准确性。 [6] # Your code to fit the model here Keep Going 继续了解这里的strides和dropout.。
http://www.zqtcl.cn/news/757765/

相关文章:

  • 温州网站建站模板建设小企业网站步骤
  • 免费企业网站我为什么电商要学网站建设
  • 建设网站员工招聘策划方案win2012 iis配置网站
  • 织梦cms 5.6网站地图图标怎么在wordpress
  • instagram wordpress北京seo学校
  • 网站优化的基本思想企业网站建设和运营
  • 网站开发电销常遇到问题怎么建立一个群
  • worldpress 建站少儿编程加盟费一般多少钱
  • 哪个公司做网站建设好九一人才网赣州招聘官网
  • 城阳区规划建设局网站哈尔滨网站建设好
  • 中小型网站建设价位无锡有哪些互联网公司
  • 网站内容收费jquery 网站框架
  • 自己建网站买玩具外贸网站如何做推广
  • 网站 配色表注册公司有什么风险
  • 网站管理员登陆后缀重庆建筑证书查询网站
  • 义乌seoseo建站外贸
  • 只做早餐的网站老网站做seo能不能重新注册
  • 门户网站开发需要多少钱百姓网网站源码
  • 网站设计要学哪些保山网站建设
  • 怎样免费设计网站建设企业网站系统源码
  • 海报设计模板网站找网络公司做网站需要注意
  • 网站开发前端后端书籍wordpress 加文章列表
  • 泰安北京网站建设商业网站的后缀一般为
  • 必须网站的访问量wordpress标题大小
  • qq怎么做放资源的网站英语seo什么意思
  • 学生心理健康网站建设论文php开源内容管理系统
  • 机关网站内容建设雄安专业网站建设
  • 有域名有空间怎么做网站怎么制作网站封面
  • 注册域名哪个网站好信息技术制作网站首页
  • 企业网站app制作价格国外外链平台