简体   繁体   English

稀疏连接的网络 Keras

[英]Sparsely connected networks Keras

I am working with custom-made networks in Keras, which tend to be sparsely more often than densely connected, but there is a problem.我正在使用 Keras 中的定制网络,这些网络往往稀疏而不是密集连接,但存在一个问题。 Instead of usual 10 seconds to train and evaluate the results of a network on MNIST dataset, these sparsely connected networks take about 15 mins each which is a really big difference, so my concern here is - is this the normal behavior of sparsely connected networks that are badly connected or is it something else?与通常 10 秒在 MNIST 数据集上训练和评估网络结果不同,这些稀疏连接的网络每个需要大约 15 分钟,这是一个非常大的差异,所以我担心的是 - 这是稀疏连接网络的正常行为吗?连接不良还是其他原因? Also, the optimizer that I use is SGD, but I don't think that it is the cause of this problem.另外,我使用的优化器是 SGD,但我不认为这是导致此问题的原因。

You might have to post some of the output from both your dense and sparse network, but if you haven't changed any other parameters besides the network, then I would say the time increase is normal.您可能需要发布密集和稀疏网络的一些输出,但是如果除了网络之外您没有更改任何其他参数,那么我会说时间增加是正常的。 HOWEVER , I would need to know the exact architecture of both networks to be 100% certain.但是,我需要知道两个网络的确切架构才能 100% 确定。

You also mentioned that you are using the optimizer SGD, which I believe is also perfectly fine.您还提到您正在使用优化器 SGD,我相信它也非常好。 However, if you want to increase the speed of training, I would suggest you look into the Adam optimizer.但是,如果您想提高训练速度,我建议您查看 Adam 优化器。 This is because, while SGD generalizes better for finding the minimum, Adam is faster.这是因为,虽然 SGD 可以更好地概括找到最小值,但 Adam 更快。 Here is a blog post about the differences between SGD and Adam and which would work in your specific case. 是一篇关于 SGD 和 Adam 之间差异的博客文章,哪些适用于您的特定情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM