Python Keras深度学习包的数据类型是什么? [英] What is data type for Python Keras deep learning package?

查看:57
本文介绍了Python Keras深度学习包的数据类型是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有找到需要使用链接的Python Keras deep learning package数据类型的任何信息.我检查了数组和列表,但返回了错误.有任何线索吗?

解决方案

Keras使用包含theano.config.floatX浮点类型的numpy数组.可以在您的 .theanorc 文件中进行配置.

通常,对于CPU计算,它将为float64;对于GPU计算,它将为float32,尽管您也可以根据需要在使用CPU时将其设置为float32.

您可以通过命令创建正确类型的零填充数组

X = numpy.zeros((4,3), dtype=theano.config.floatX)

I didn't find anything about data type that we need to work with Python Keras deep learning package with this link. I checked array and list but returned error. Any clue?

解决方案

Keras uses numpy arrays containing the theano.config.floatX floating point type. This can be configured in your .theanorc file.

Typically, it will be float64 for CPU computations and float32 for GPU computations, although you can also set it to float32 when working on the CPU if you prefer.

You can create a zero-filled array of the proper type by the command

X = numpy.zeros((4,3), dtype=theano.config.floatX)

这篇关于Python Keras深度学习包的数据类型是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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