香草 jboss 工具

Nowadays, Tensorflow is a highly demanded skill in the market, ensuring ease of production, standardizing some crucial stages of Machine Learning.

如今,Tensorflow是市场上急需的技能,可确保易于生产,标准化了机器学习的某些关键阶段。

Today you’ll learn how to make your first neural network with Tensorflow; We’re going to build a Multilayer Perceptron model, also called the “Vanilla” Neural Network. Are you ready? So let’s start!

今天,您将学习如何使用Tensorflow制作您的第一个神经网络 ; 我们将建立一个多层感知器模型,也称为“香草”神经网络。 你准备好了吗? 让我们开始吧!

rawpixel.com — Freepikrawpixel.com — Freepik

目录 (Table of Contents)

  • What is Tensorflow?什么是Tensorflow?
  • What is a Neural Network?什么是神经网络?
  • The Google ColabGoogle Colab
  • Structure of Today’s Project当今项目的结构
  • Keras? What is that?凯拉斯? 那是什么?
  • Building our Model建立我们的模型
  • Fit with training sets适合训练套
  • Evaluation with validation sets验证集评估
  • Prediction with test sets使用测试集进行预测
  • Final Considerations最后考虑
  • Bibliography参考书目

什么是Tensorflow? (What is Tensorflow?)

Tensorflow — WebsiteTensorflow —网站

Tensorflow is a platform that focuses on Machine Learning, providing tools to create models for different ecosystems; With this, you can run Machine Learning models on mobile devices, cloud, servers, and more. Let’s check out the definition of Tensorflow by Google:

Tensorflow是一个专注于机器学习的平台,提供用于创建不同生态系统模型的工具; 这样,您就可以在移动设备,云,服务器等上运行机器学习模型。 我们来看看Google对Tensorflow的定义:

"TensorFlow is an end-to-end open source platform for machine learning. It has a comprehensive, flexible ecosystem of tools, libraries and community resources that lets researchers push the state-of-the-art in ML and developers easily build and deploy ML powered applications."

“ TensorFlow是一个用于机器学习的端到端开源平台。它具有一个全面,灵活的工具,库和社区资源生态系统,可让研究人员推动机器学习的最新发展,并使开发人员轻松构建和部署ML支持的应用程序。”

It’s important to know that Tensorflow provides libraries and extensions for several situations; One of the most used is the Tensorflow Hub, which allows Machine Learning Engineers to reuse already trained models to train new ones, using the Transfer Learning method.

重要的是要知道Tensorflow为多种情况提供了库和扩展。 最常用的工具之一是Tensorflow Hub ,它使机器学习工程师可以使用转移学习方法重用已经受过训练的模型来训练新模型。

什么是神经网络? (What is a Neural Network?)

Generally, the easiest way to explain them is to say that they’re related to neurons in the animal brain but created by engineers, using the name Artificial Neural Network (ANN).

通常,解释它们的最简单方法是说它们与动物大脑中的神经元有关,但由工程师使用人工神经网络(ANN)的名称创建。

Image by Renan Lolico — Medium
图片由Renan Lolico —中

Designed to recognize patterns, they act like neurons, triggering when one is detected. Artificial Neural Networks are based on the animal’s Central Nervous System but not identical, just similar. It’s a common mistake when talking about neural networks.

它们旨在识别模式,就像神经元一样 ,在检测到模式时触发。 人工神经网络基于动物的中枢神经系统,但不完全相同,只是相似。 在谈论神经网络时,这是一个常见的错误。

Neural networks are composed of input, hidden and output layers; The Input Layer is the first, where our data is added; The hidden layers are the “neurons” that adjust the weight and bias for each epoch; Finally, it's in the output layer that we receive a response from our model, based on the target.

神经网络由输入,隐藏和输出层组成 ; 输入层是第一层,添加了我们的数据; 隐藏的层是“神经元” ,可调整每个时期的权重和偏差。 最后,在输出层中,我们根据目标从模型接收响应。

Epoch is the number of times our Machine Learning model pass through the entire training data; Inside each epoch, the weight and bias are computed in order to make our model find better patterns.

时代是我们的机器学习模型遍历整个训练数据的次数; 在每个时期内,计算权重和偏差以使我们的模型找到更好的模式。

A Neural Network Playground — Google神经网络游乐场-Google

If you’re new to Neural Networks, check out this Google playground; You can modify the number of epochs, activation, learning rate, and more (without breaking your model).

如果您不熟悉神经网络, 请访问此Google游乐场 ; 您可以修改时期数,激活次数,学习率等(不破坏模型)。

多层感知器 (The Multilayer Perceptron)

Today we will be building a Multilayer Perceptron (MLP), also called the “Vanilla” Neural Network; By default, this type of MLP has only a single hidden layer and looks like the gif above.

今天,我们将建立一个多层感知器(MLP),也称为“香草”神经网络。 默认情况下,这种类型的MLP仅具有一个隐藏层 ,看起来像上面的gif。

Being one of the simplest types of neural networks, the Multilayer Perceptron is perfect to understand how a neural network works and each step of the entire process.

作为最简单的神经网络类型之一,多层感知器非常适合了解神经网络的工作原理以及整个过程的每个步骤。

Google合作实验室 (The Google Colaboratory)

We’ll use Google Colab, a tool based on the Jupyter Notebook that allows data scientists to work quickly and intelligently. By default, Google Colab comes with the necessary packages to work with Data Science and Machine Learning.

我们将使用Google Colab,这是一种基于Jupyter Notebook的工具,可让数据科学家快速而智能地工作。 默认情况下,Google Colab随附了与数据科学和机器学习一起使用所需的软件包。

Also, it is a great tool for anyone who focuses on performance: Google offers a GPU that speeds up processes. Simply put, you don’t have to worry about installing packages, machine memory, or backup, Google saves your progress to your Google Drive account.

同样,对于任何关注性能的人来说,它也是一个很好的工具:Google提供了可加快处理速度的GPU。 简而言之, 您不必担心安装软件包,机器内存或备份 ,Google会将您的进度保存到您的Google云端硬盘帐户中。

Click here to access the Google Colab introduction tutorial.

单击此处以访问Google Colab入门教程。

当今项目的结构 (Structure of Today’s Project)

To make it easier, we’ll work on a regression data; I’ll just focus on creating our Multilayer Perceptron, but you can click here to check out other steps, like Data Cleaning and Feature Engineering, for example.

为了简化起见,我们将处理回归数据。 我将只专注于创建多层感知器,但是您可以单击此处查看其他步骤,例如,数据清理和功能工程。

关于我们的数据 (About our Data)

Image by Renan Lolico — Medium
图片由Renan Lolico —中

We’ll use the “Auto MPG” data provided by UCI, click here to take a look. We’ll predict the miles per gallon (MPG) parameter based on 7 different features.

我们将使用UCI提供的“自动MPG”数据, 点击此处进行查看 。 我们将基于7种不同的功能预测每加仑英里数(MPG)参数。

预处理数据 (Preprocessing the Data)

Even before we start building our model, we need to modify our data. Here I'll make some changes to prepare our data to fit well with our model.

甚至在开始构建模型之前,我们都需要修改数据。 在这里,我将进行一些更改以准备我们的数据以使其适合我们的模型。

a) Train, validation and test

a)培训,验证和测试

First, let’s divide our data. This is necessary to train our model, evaluate, and finally predict, in order to check how good our model becomes in finding patterns.

首先,让我们划分数据。 这对于训练我们的模型,评估并最终做出预测是必要的,以便检查我们的模型在发现模式方面的表现如何。

b) Standardization

b)标准化

Now that the data is divided, let’s standardize it (mean = 0, std = 1). This step is necessary when our data contains different units of measure, like the "weight" and the "cylinders" columns, helping to “standardize” them.

现在,数据已被分割,让我们对其进行标准化(平均值= 0,std = 1)。 当我们的数据包含不同的度量单位(例如“重量”和“圆柱”列)以帮助对其进行“标准化”时,此步骤是必需的。

That’s it! With the data ready to proceed, we can finally continue talking about Tensorflow! But calm down, a wild Pokémon appeared: let’s talk about Keras.

而已! 随着数据准备就绪,我们终于可以继续谈论Tensorflow! 但是冷静下来,出现了一只狂野的神奇宝贝:让我们谈谈Keras。

凯拉斯? 那是什么? (Keras? What is that?)

Keras.ioKeras.io

Keras’ main goal is to make our lives easier when it comes to deep learning; Let’s check the official definition directly from the Keras website:

Keras的主要目标是在深度学习方面让我们的生活更轻松; 让我们直接从Keras网站检查官方定义:

"Keras is an API designed for human beings, not machines. Keras follows best practices for reducing cognitive load: it offers consistent & simple APIs, it minimizes the number of user actions required for common use cases, and it provides clear & actionable error messages".

“ Keras是为人类而非机器而设计的API。Keras遵循降低认知负担的最佳实践:它提供一致且简单的API,它减少了常见用例所需的用户操作数量,并提供了清晰且可操作的错误消息”。

Keras.io

Keras.io

Tensorflow has an in-built version of Keras that provides powerful tools for creating and managing neural networks; With a few lines of code, you’re ready to train your neural network!

Tensorflow具有Keras的内置版本,该版本提供了用于创建和管理神经网络的强大工具。 只需几行代码,您就可以训练神经网络了!

建立我们的模型 (Building our Model)

The time has come, we can create our Vanilla Neural Network! We'll use the Keras Sequential API, which — as the name suggests — allows us to create a model piece by piece. Let’s write our code first, then I’ll explain.

时机已到,我们可以创建我们的香草神经网络! 我们将使用Keras Sequential API,顾名思义,它允许我们逐段创建模型。 让我们先编写代码,然后再解释。

First, we start by defining our model structure; As you can see, I called the Sequential API and added through three layers:

首先,我们从定义模型结构开始; 如您所见,我调用了顺序API,并通过三层添加:

  • The input layer, that takes as a parameter the number of features that our data have (without the target);

    输入层 ,将数据具有的特征数量(不包含目标)作为参数;

  • The hidden layer with the count of “neurons” and the activation method, which I'll explain below;

    具有“神经元”数量和激活方法的隐藏层 ,我将在下面解释;

  • The output layer with a single neuron (our predicted value).

    具有单个神经元的输出层 (我们的预测值)。

The activation functions decide whether a neuron should be fired or not, based on the sum of the input, weight, and trend. There is no correct/incorrect activation to use, but a good starting point is with the ReLu function; If you want to go deeper into the activation functions, click here to check the Keras page.

激活函数根据输入,权重和趋势的总和来决定是否应触发神经元 。 没有正确/错误的激活方法,但是ReLu功能是一个很好的起点。 如果您想更深入地了解激活功能, 请单击此处查看Keras页面。

编译模型 (Compiling our Model)

After creating our model with its respective layers, we need to compile it with some extra parameters: loss, optimizer, and metrics; Let's check what each one does:

在创建具有相应层的模型后,我们需要使用一些额外的参数对其进行编译:损失,优化器和指标; 让我们检查一下每个函数:

  • The loss is used to gauge how wrong our model is predicting;

    损失用于评估我们的模型预测的错误程度 ;

  • The optimizer is used to modify the weight and the bias, seeking to reduce the loss;

    优化器用于修改权重和偏差,以寻求减少损失的方法。

  • Finally, the metrics are the measures that we will use to verify the accuracy of the model.

    最后,度量是我们将用来验证模型准确性的度量

适合训练套装 (Fit with training set)

It’s time to fit our training set. We'll give about 70% of our data set to the model so that we can use it to look for patterns. Let’s see this in the code!

是时候适合我们的训练了。 我们会将大约70%的数据集提供给模型,以便我们可以使用它来查找模式。 让我们在代码中看到这一点!

When you run the code, you'll see that a long log will start to appear. For each epoch, our model will calculate metrics and loss, trying to reduce both; The first one is called Mean Absolute Error (MAE), while the other is the Mean Squared Error (MSE).

运行代码时,您会看到一条长日志开始出现。 对于每个时期,我们的模型都会计算指标和损失,并尝试减少两者 ; 第一个称为均值绝对误差(MAE),而另一个称为均方误差(MSE)。

Image by Renan Lolico — Medium
图片由Renan Lolico —中

By modifying the epoch and the learning rate, you can get better results; Besides, there are automatic ways to do this, using Keras Callbacks, but this will be discussed in another article.

通过修改时代和学习率,可以获得更好的结果; 此外,还有一些自动方法可以使用 Keras回调 ,但这将在另一篇文章中进行讨论。

The final output shows that our model is predicting a value with a small mean absolute error, that’s acceptable, but make no mistake: so far our model has only seen the training data, let’s evaluate with our validation set.

最终输出表明,我们的模型正在预测平均绝对误差很小的值,这是可以接受的,但没有犯错:到目前为止,我们的模型只看到了训练数据,让我们使用验证集进行评估。

验证集评估 (Evaluation with validation set)

Our model was trained! So far, we have noticed that it's doing well, considering that it’s a Vanilla Neural Network; Our next step is to see how he does with the validation data, which he has never seen before. First, see that the code isn’t at all complicated.

我们的模型已经过训练! 到目前为止,考虑到它是Vanilla Neural Network,我们注意到它运行良好。 我们的下一步是查看他如何处理验证数据,这是他从未见过的。 首先,请看代码一点也不复杂。

Image by Renan Lolico — Medium
图片由Renan Lolico —中

Look at that! As expected, our model was a little worse this time; This happens when we don’t have enough training data or our Neural Network is too simple or complex to address the problem.

看那个! 不出所料,这次我们的模型差一点了。 当我们没有足够的训练数据或者我们的神经网络太简单或太复杂而无法解决问题时,就会发生这种情况。

During the evaluation step, you need to improve your model, looking for more data, trying a different learning rate, time or activation function, and so on. After that, your model will be ready to predict data never seen before.

在评估步骤中,您需要改进模型,查找更多数据,尝试不同的学习率,时间或激活功能,等等。 之后,您的模型将准备好预测从未见过的数据。

使用测试集进行预测 (Prediction with test set)

Finally, after all these steps, your model will be able to predict real-life data; For this, I separated the test set, where you predict the results with your model, looking for the best results.

最后,完成所有这些步骤后,您的模型将能够预测现实生活中的数据; 为此,我分离了测试集,您可以在其中用模型预测结果,以寻找最佳结果。

Your model is ready to be used! Let’s check the chart below, which shows how correct our prediction was compared to the real value.

您的模型已准备就绪,可以使用! 让我们检查下面的图表,该图表显示了我们将预测与真实值进行比较的正确性。

Image by Renan Lolico — Medium
图片由Renan Lolico —中

Not bad for the first model; Do you want to improve it? Try adding another hidden layer, changing the learning rate and the number of epochs. Have a good time.

对于第一个模型来说还不错; 您想改善吗? 尝试添加另一个隐藏层,更改学习率和时期数。 玩的很开心。

最后考虑 (Final Considerations)

Congratulations! You’ve created your Vanilla Neural Network with Tensorflow and Keras! How about keep learning? This will help you to upgrade your skills!

恭喜你! 您已经使用Tensorflow和Keras创建了Vanilla神经网络! 继续学习怎么样? 这将帮助您提升技能!

就是这样,伙计们! (That’s it, folks!)

I hope you enjoyed this content and can apply your new knowledge with mastery! If you want to keep learning something interesting every day, I’ll be happy to share great content with you!

希望您喜欢此内容,并能精通您的新知识! 如果您想每天继续学习有趣的事情 ,我们将很乐意与您分享精彩的内容!

In addition, you can check my profile on Github. I’ve been working with some data science projects for some time. All the key concepts are there to learn and reuse!

此外,您可以在Github上查看我的个人资料。 我从事某些数据科学项目已有一段时间了。 所有关键概念都可以学习和重用!

参考书目 (Bibliography)

  • Coding Neural Network — Forward Propagation and Backpropagation

    编码神经网络-正向传播和反向传播

  • The Sequential API — Keras

    顺序API-Keras

  • Regression with Tensorflow — Tensorflow

    使用Tensorflow进行回归-Tensorflow

翻译自: https://towardsdatascience.com/creating-a-vanilla-neural-network-with-tensorflow-96fec241e369

香草 jboss 工具


http://www.taodudu.cc/news/show-1874128.html

相关文章:

  • 机器学习 深度学习 ai_人工智能,机器学习和深度学习。 真正的区别是什么?...
  • 锁 公平 非公平_推荐引擎也需要公平!
  • 创建dqn的深度神经网络_深度Q网络(DQN)-II
  • kafka topic:1_Topic️主题建模:超越令牌输出
  • dask 于数据分析_利用Dask ML框架进行欺诈检测-端到端数据分析
  • x射线计算机断层成像_医疗保健中的深度学习-X射线成像(第4部分-类不平衡问题)...
  • r-cnn 行人检测_了解用于对象检测的快速R-CNN和快速R-CNN。
  • 语义分割空间上下文关系_多尺度空间注意的语义分割
  • 自我监督学习和无监督学习_弱和自我监督的学习-第2部分
  • 深度之眼 alexnet_AlexNet带给了深度学习的世界
  • ai生成图片是什么技术_什么是生成型AI?
  • ai人工智能可以干什么_我们可以使人工智能更具道德性吗?
  • pong_计算机视觉与终极Pong AI
  • linkedin爬虫_这些框架帮助LinkedIn大规模构建了机器学习
  • 词嵌入生成词向量_使用词嵌入创建诗生成器
  • 端到端车道线检测_如何使用Yolov5创建端到端对象检测器?
  • 深度学习 检测异常_深度学习用于异常检测:全面调查
  • 自我监督学习和无监督学习_弱和自我监督的学习-第3部分
  • 聊天工具机器人开发_聊天机器人-精致的交流工具? 还是您的客户服务团队不可或缺的成员?...
  • 自我监督学习和无监督学习_弱和自我监督的学习-第4部分
  • ai星际探索 爪子_探索AI地牢
  • 循环神经网络 递归神经网络_递归神经网络-第5部分
  • 用于小儿肺炎检测的无代码AI
  • 建筑业建筑业大数据行业现状_建筑—第2部分
  • 脸部识别算法_面部识别技术是种族主义者吗? 先进算法的解释
  • ai人工智能对话了_产品制造商如何缓解对话式AI中的偏见
  • 深度神经网络 轻量化_正则化对深度神经网络的影响
  • dbscan js 实现_DBSCAN在PySpark上的实现
  • 深度学习行人检测简介_深度学习简介
  • ai初创企业商业化落地_初创企业需要问的三个关于人工智能的问题

香草 jboss 工具_使用Tensorflow创建香草神经网络相关推荐

  1. 香草 jboss 工具_如何为JBoss Developer Studio 8设置BPM和规则工具

    香草 jboss 工具 最新的JBoss Developer Studio(JBDS)的发布带来了有关如何开始使用尚未安装的各种JBoss Integration和BPM产品工具集的问题. 在本系列文 ...

  2. [Python人工智能] 四.TensorFlow创建回归神经网络及Optimizer优化器

    从本篇文章开始,作者正式开始研究Python深度学习.神经网络及人工智能相关知识.前一篇文章讲解了TensorFlow基础和一元直线预测的案例,以及Session.变量.传入值和激励函数:这篇文章将详 ...

  3. python2.0迅雷下载_《Tensorflow 2.0神经网络实践》高清完整PDF版 下载

    1.封面介绍 2.出版时间 2020年7月 3.推荐理由 适读人群 :希望了解TensorFlow结构和新特性的数据科学家.机器学习的开发人员.深度学习的研究人员和具有统计知识的开发者.要充分利用这本 ...

  4. Tensorflow创建循环神经网络

    虽然已经接触deep learning很长一段时间了,也看了很久rnn相关的代码,但是突然想用tensorflow实现一些功能的时候,突然发现丝毫没有头绪,找了一些资料,学习了一波,记录一下. 一.t ...

  5. python神经网络库识别验证码_基于TensorFlow 使用卷积神经网络识别字符型图片验证码...

    本项目使用卷积神经网络识别字符型图片验证码,其基于TensorFlow 框架.它封装了非常通用的校验.训练.验证.识别和调用 API,极大地减低了识别字符型验证码花费的时间和精力. 项目地址:http ...

  6. pycharm创建python工程_使用Pycharm(Python工具)新建项目及创建Python文件的教程

    创建项目 首先打开Pycharm 勾选I confirm that I have read and accept the terms of this User Agreement 接下来选择Don't ...

  7. 善用工具_如何善用色彩心理学

    善用工具 There's a problem with my movement. Most of us in the profession of trying to change the world ...

  8. tensorflow http调用_《TensorFlow 内核剖析》笔记——系统架构

    3 系统架构 系统整体组成:Tensorflow的系统结构以C API为界,将整个系统分为前端和后端两个子系统: 前端构造计算图 后端执行计算图,可再细分为: 运行时:提供本地模式和分布式模式 计算层 ...

  9. python交互式和文件式_使用Python创建和自动化交互式仪表盘

    python交互式和文件式 In this tutorial, I will be creating an automated, interactive dashboard of Texas COVI ...

  10. Excel股票分析工具_每日连板清单

    Excel获取每日连板数据 对所有股票数据进行监控,选出涨停板股票清单: 可以查看昨日数据今日的涨跌情况    后端采用VBA通过API获取数据并创建前台分析链接 可以查看昨日数据在今日的涨跌情况, ...

最新文章

  1. Java构造和解析Json数据的两种方法详解一
  2. 黑客与网管的30天较量
  3. [Qt教程] 第14篇 2D绘图(四)绘制路径
  4. CoreCRM 开发实录——开始之新项目的技术选择
  5. Android之mvp和mvc对比分析以及实际应用
  6. 《零基础看得懂的C语言入门教程 》——(十一)C语言自定义函数真的很简单
  7. 领域应用 | 从数据到智慧,知识图谱如何推动金融更智能?
  8. OpenCV3.4.1+opencv_contrib编译:windows10
  9. 参加工作第三个月的感悟
  10. 解决bootstrap-table表头filter-control select控件被遮挡显示不全的问题
  11. oracle structure,oracle memory structure
  12. 智能家居设计原理c语言,基于51单片机智能家居系统设计
  13. Android百度地图SDK:隐藏比例尺,隐藏百度LOGO,隐藏缩放控件
  14. 计算机专业cad 办公 ps,厦门集美办公、商务办公、CAD、PS、平面设计培训
  15. android 蓝牙触控笔,FiftyThree 53 Paper pencil 电容笔蓝牙触控笔 上手试用
  16. 类在c++中的初步运用
  17. 【Opencv】【C++】 Opencv之calcHist() 计算直方图
  18. android 7种网络连接方式--IT蓝豹
  19. vue移动端下拉刷新组件、上拉加载组件
  20. 数字趣解-不可思议的《魔兽世界》

热门文章

  1. Json简介与转换数据例子
  2. 解决IIS进程回收后第一次访问慢的问题
  3. windows.2003.应用网络负载平衡管理器实现均衡负载与双机热备
  4. 在MAC OS X下安装usb转串口驱动(PL2303主控芯片)
  5. ps 缩放 颜色分类 像素和分辨率学习笔记
  6. vs C++实现Socket通信、添加ws2_32.lib 动态链接库
  7. 黑马程序员 Python学习笔记之PyCharm 的初始设置
  8. main(int argc, char** argv) 参数的含义
  9. Atitit ever note org log t99 目录 1. data 1 2. Sik dsk zip mode 1 3. Local exted stat 2 4. Recy 3 1
  10. Atitit ocr的艺术 艾提拉著 目录 1. OCR可以说是一门非常“古老”的技术,在上世纪50年代到90年代, 1 1.1. 场景文字识别技术(Scene Text Recognition,