使用多个文件训练机器学习模型
我是深度学习方面的新手,特别是每次处理多个文件。我有一个文件文件夹,我希望我的模型(LSTM)文件使用所有这些文件进行训练。
我可以在路径文件的循环中使用 model.fit() 吗?这有意义吗?或者我应该尝试将其连接到一个数组中?在这种情况下,问题是特征具有不同的范围。
import os
rootdir = '/content/Data' #looping over files
for filename in os.listdir('/content/Data'):
with open(os.path.join(rootdir, filename)) as f:
A = np.loadtxt(f) model.fit(x_train, y_train, batch_size=50,
epochs=20, shuffle=True)
I'm kind of new in working with deep learning, and specially with more than one file per time. I have a folder of files, and I want that my model(LSTM) files train with all that files.
Can I just use model.fit() inside a loop of a path files? Would it make sense? Or I should try to concatenate that into a single array? In this case the problem is the features have different ranges.
import os
rootdir = '/content/Data' #looping over files
for filename in os.listdir('/content/Data'):
with open(os.path.join(rootdir, filename)) as f:
A = np.loadtxt(f) model.fit(x_train, y_train, batch_size=50,
epochs=20, shuffle=True)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论