Row 2221
Content Data
This page contains data entry 2221 from the Axioma AXP content repository. The structured data below represents the complete record for this entry.
""" from tensorflow.keras.preprocessing.sequence import pad\_sequences import tensorflow as tf
maxlen = 500
X\_train = pad\_sequences(X\_train, maxlen=maxlen, padding='post', truncating='post') X\_test = pad\_sequences(X\_test, maxlen=maxlen, padding='post', truncating='post') X\_train\_reshaped = X\_train.reshape((\*X\_train.shape, 1)) X\_test\_reshaped = X\_test.reshape((\*X\_test.shape, 1))
model = Sequential() model.add(LSTM(128)) model.add(Dense(1, activation="sigmoid")) model.compile(optimizer='adam', loss='binary\_crossentropy') #model.summary() model.fit(X\_train, y\_train, epochs=10, validation\_data=(X\_test, y\_test), verbose=2)
"""
I keep getting the error and I am not sure what I am doing wrong as I nearly copied the same exact example as the code shown in this website([https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/](https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/))
Call arguments received by layer "sequential" " f"(type Sequential): • inputs=tf.Tensor(shape=(None, 500), dtype=int32) • training=True • mask=None
| Field | Value |
|---|---|
| text | """ from tensorflow.keras.preprocessing.sequence import pad\_sequences import tensorflow as tf maxlen = 500 X\_train = pad\_sequences(X\_train, maxlen=maxlen, padding='post', truncating='post') X\_test = pad\_sequences(X\_test, maxlen=maxlen, padding='post', truncating='post') X\_train\_reshaped = X\_train.reshape((\*X\_train.shape, 1)) X\_test\_reshaped = X\_test.reshape((\*X\_test.shape, 1)) model = Sequential() model.add(LSTM(128)) model.add(Dense(1, activation="sigmoid")) model.com… |
| label | r/tensorflow |
| dataType | post |
| communityName | r/tensorflow |
| datetime | 2023-07-19 |
| username_encoded | Z0FBQUFBQm5LakwwNXlEeUt0S2x4UFhxOGk4OGhRTmpHLVVmTGt1U01BTFB1Q0dqWXhCN09EQkN4ZXoxb1R0WnZ5M1ZaOVRLaFBFaEsxS3VqZ1pQczlKZlVwb01UTm1rZFE9PQ== |
| url_encoded | Z0FBQUFBQm5Lak9FRTdUVjVHQVN1Q1NUYW04UlhGR1FjaFpGVGs5QWFXb0Z5MUNaV1hRb3FCa21GOHlvbTkwYzhuck8zVF9vd3I0b1F4eExwa1JDd3ZjYWtVejFRYWg5T2ltRHJZWEQtcHhzeWx5MS1neXRkSXBtZDJPVThJNWpmNWV0amRkWmVCcnU1ZHNEVDRhc0JDNXQxSmFWekJpOTRGR2pjYk0tdFF4ZUwwbXg1MUdCZTlsdURLck1aUGxOVXNMd0c0R3F4TU55ckV3WVRmRjdQRGU0bk5lV0I4VVh0UT09 |
Raw Record
{
"text": "\"\"\" \nfrom tensorflow.keras.preprocessing.sequence import pad\\_sequences import tensorflow as tf \n\n\nmaxlen = 500\n\nX\\_train = pad\\_sequences(X\\_train, maxlen=maxlen, padding='post', truncating='post') X\\_test = pad\\_sequences(X\\_test, maxlen=maxlen, padding='post', truncating='post') X\\_train\\_reshaped = X\\_train.reshape((\\*X\\_train.shape, 1)) X\\_test\\_reshaped = X\\_test.reshape((\\*X\\_test.shape, 1))\n\nmodel = Sequential() model.add(LSTM(128)) model.add(Dense(1, activation=\"sigmoid\")) model.compile(optimizer='adam', loss='binary\\_crossentropy') #model.summary() model.fit(X\\_train, y\\_train, epochs=10, validation\\_data=(X\\_test, y\\_test), verbose=2)\n\n \"\"\"\n\nI keep getting the error and I am not sure what I am doing wrong as I nearly copied the same exact example as the code shown in this website([https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/](https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/))\n\nCall arguments received by layer \"sequential\" \" f\"(type Sequential): • inputs=tf.Tensor(shape=(None, 500), dtype=int32) • training=True • mask=None",
"label": "r/tensorflow",
"dataType": "post",
"communityName": "r/tensorflow",
"datetime": "2023-07-19",
"username_encoded": "Z0FBQUFBQm5LakwwNXlEeUt0S2x4UFhxOGk4OGhRTmpHLVVmTGt1U01BTFB1Q0dqWXhCN09EQkN4ZXoxb1R0WnZ5M1ZaOVRLaFBFaEsxS3VqZ1pQczlKZlVwb01UTm1rZFE9PQ==",
"url_encoded": "Z0FBQUFBQm5Lak9FRTdUVjVHQVN1Q1NUYW04UlhGR1FjaFpGVGs5QWFXb0Z5MUNaV1hRb3FCa21GOHlvbTkwYzhuck8zVF9vd3I0b1F4eExwa1JDd3ZjYWtVejFRYWg5T2ltRHJZWEQtcHhzeWx5MS1neXRkSXBtZDJPVThJNWpmNWV0amRkWmVCcnU1ZHNEVDRhc0JDNXQxSmFWekJpOTRGR2pjYk0tdFF4ZUwwbXg1MUdCZTlsdURLck1aUGxOVXNMd0c0R3F4TU55ckV3WVRmRjdQRGU0bk5lV0I4VVh0UT09"
}
Entry Information
- Entry ID: 2221
- Repository: Axioma AXP
- Dataset: arrmlet/reddit_dataset_36
- Total Entries: 100,000