Python Tflearn机器学习优化器,损失和参数 [英] Python Tflearn machine learning Optimiser, loss and parameters

查看:156
本文介绍了Python Tflearn机器学习优化器,损失和参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

修复代码并准备好数据进行培训后,我发现自己遇到了2个问题.

背景: 我有第一列的日期(每分钟一个条目)和第二列的拥塞(值在0到200之间)的数据.我的目标是将其馈送到我的神经网络,以便能够在下周预测每分钟的拥塞(我的数据集超过了10M的条目,我应该不会缺少训练数据的问题). /p>

问题: 我现在有两个问题.首先是关于损耗,优化器和线性的问题.似乎它们中有一定数量,并且它们都有各自的领域,它们比另一个要好,您会为该项目推荐哪个? (目前,在我的测试中,我使用Adam作为优化器,将mean_square用作损耗,并使用线性来激活).

我的第二个问题更像是我的错误(可能使用错误的损耗/优化器链接到我).当使用我的代码(目前有10,000个训练数据)时,我的精度为0,损失为低(0.00X),预测错误(甚至不接近实际情况).您是否知道它的来源?

解决方案

您要尝试做的就是称为时间序列预测(时间 tn,t-(n + 1)... t- 1 :预测时间 t 的状态,通常是递归神经网络的任务. 此处是Andrej Karpathy撰写的精彩博客文章,内容涉及你应该看看.

关于您的两个问题:

  1. 这很难回答,因为要使用哪种优化器的问题很大程度上取决于输入数据.一般来说,无论您使用哪种优化程序,网络都将收敛.但是,收敛所需的时间会有所不同.像Adagrad,Adadelta和Adam这样的自适应学习率方法往往会更快地达到收敛. 此处是不同优化器的不错写法.

  2. 基本神经网络(MLP)在时间序列预测中表现不佳.那将是低精度的一种解释.但是我不知道为什么损失会是0.

After fixing my code and prepare my data for training I've found myself in front of 2 question.

Background: I have data made of date (one entry per minute) for the first column and congestion (value, between 0 and 200) for the 2nd. My goal is to feed it to my neural network and so be able to predict for the next week the congestion at each minute (my dataset is more than 10M of entry, I shouldn't have problem of lack of data for training).

Problem: I now have two question. First about the loss, optimizer and linear. It seem there is a certain number of them and they all have a domain where they are better than the other, which one would you recommend for this project? (Currently on my test I use Adam as an optimizer and mean_square as loss and linear for activation).

My second question is more like an error that I have (may be linked to me using the wrong loss/optimizer). When using my code (10 000 data of training for now) I have an accuracy of 0, a low loss (0.00X) and a bad prediction (not even close to the reality). Do you have any idea of where it could come from?

解决方案

What you are trying to do is called time series prediction (given data at time t-n, t-(n+1) ... t-1: predict the state at time t) and is generally a task for a recurrent neural network. Here is the great blog post by Andrej Karpathy about the topic that you should have a look at.

About your two questions:

  1. This is hard to answer since the question of what optimizer to use highly depends on the input data. Generally speaking the network will converge no matter what optimizer you use. The time it takes to converge will differ however. Adaptive learning-rate methods, like Adagrad, Adadelta, and Adam tend to achieve convergence slightly faster. Here is a good write-up of the different optimizers.

  2. Basic neural networks (MLPs) don't do well with time series prediction. That would be an explanation for the low accuracy. However I don't know why the loss would be 0.

这篇关于Python Tflearn机器学习优化器,损失和参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆