

At some point you will probably need to convert your integer data to float, but this may occur as a side-effect of certain pre-processing. However, you probably want to provide rows of data to your model, so translating from columns to rows may be one source of confusion. This provides access to the columns via their labels - useful for pre-processing. ), the first step is usually to load the CSV data in a column-oriented format. Because CSVs can have a variety of column types (numerical, boolean, text, categorical. If you persist with the CSV Dataset approach, understand that there are many ways CSVs are used, and different approaches to loading them (e.g. You can do it without datasets (as shown below) so long as ALL the data is integers. The data size indicated will probably fit in memory, and a tf.data.Dataset may wrap the data in more complexity than valuable functionality. It is likely that CSV Datasets are not required for this task. although the answers mostly relate to Tensorflow V1.x but it's not clear where these compatibility problems lie - are they in the input shape, the integer (not float) data, or somewhere else? this leads to compatibility problems between the dataset and the model. I have tried creating my dataset by using: train_ds = tf._csv_dataset('mydata.csv`, batch_size=B) Model.add(Dense(H, activation='relu', input_dim=N))įor my data, M > 50000 and N > 200.
#Keras give your own name to a layer sequential model how to
Can anyone provide a straightforward example to demonstrate how to do this, with clarity around data shape and type issues at a minimum, and preferably considering batching, shuffling, repeating over epochs as well?įor example, I have a CSV file of M rows, each row being an integer class label followed by N integers from which I hope to predict the class label using an old-style 3-layer neural network with H hidden neurons: model = Sequential() The documentation for CSV Datasets stops short of showing how to use a CSV dataset for anything practical like using the data to train a neural network.
