ageron / ageron/handson-ml

Using the RNNs with Dataset APIs instead of Chapter 14 approach ?

Abierto
#286 9 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
25.6k
Forks
12.7k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi -

I have been puzzled by the way you handle the data the way you do in chapter 14 on RNNs.
In particular, I am looking at your example on page 392 regarding time series.

Can you please tell me why it is you do not use the Dataset API ? I have tried using the Dataset API but I fail at it, so that maybe the reason you avoid it altogether?

The data_x is the timeseries and data_y is the timeseries one unit forward in time.

```python
x_t = tf.convert_to_tensor(data_x, np.float32)
y_t = tf.convert_to_tensor(data_y, np.float32)

dataset = tf.data.Dataset.from_tensor_slices((x_t,y_t))
dataset = dataset.batch(num_batch)
```

... so the num_batch is what you use as n_steps as it defines the lenght of the timeseries window in a batch, so not quite the same as the "number of batches".

```python
dataset = dataset.shuffle(buffer_size=10000)
dataset = dataset.repeat(num_epochs)
```

So now I have the data the way I want to have it ... nicely chupped up ... but, and here is where I get stuck - It seems to be a problem feeding the data to the model.

Have you tried something in the lines above please ?

Thank you very much in advance.

Br, Jesper

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.