简体   繁体   English

使用 Galaxy Zoo 数据集、TensorFlow 和 Keras 训练 GAN

[英]Training GAN using Galaxy Zoo dataset, TensorFlow, and Keras

What is the proper way to import Galaxy Zoo dataset in order to train a simple GAN using TensorFlow and Keras?导入Galaxy Zoo 数据集以使用 TensorFlow 和 Keras 训练简单 GAN 的正确方法是什么? Is there the same easy way as with importing MNIST, for instance?例如,是否有与导入 MNIST 相同的简单方法?

from keras.datasets import mnist

There is not a simple import for it since it is not keras dataset .没有简单的导入,因为它不是 keras dataset

You will have to download the data and preprocess it yourself before feeding into the network.在输入网络之前,您必须自己下载数据并对其进行预处理。 If you go to the kaggle link and go to notebooks, you can see how other people have preprocessed their data for training如果你转到 kaggle 链接并转到 notebooks,你可以看到其他人如何预处理他们的训练数据

It matter what you want to train on and what you are classifying.你想训练什么以及你要分类什么很重要。 If you want to train on images to classify all or some of the classes in the csv, you will need your data as images and classifications as labels.如果要对图像进行训练以对 csv 中的所有或部分类进行分类,则需要将数据作为图像并将分类作为标签。 If you wanted to use some classification to predict another classification, some classes would be the data and others would be the label you are predicting.如果您想使用某个分类来预测另一个分类,则某些类别将是数据,而其他类别将是您要预测的标签。

I recommend importing the training csv into a pandas dataframe我建议将训练 csv 导入到Pandas 数据框中

import pandas as pd
df = pd.read_csv('../input/44352/training_solutions_rev1.csv')

You would then have to create a custom generator for your images since they are not organized by class in the folder structure.然后您必须为您的图像创建一个自定义生成器,因为它们不是按文件夹结构中的类进行组织的。

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

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