Defining a Model for exclusion data block and make predictions for possible future values

Hi, We need of help on creating a Model with Keras Sequential.

We have an historical data of a System, that generates a block of Data of 12 Hexadecimal values. We need to predict the next Block of Data, but it is quitely impossible.
But what we discovered on this prediction System is a breakthrough.

Each data block contains 12 values, which can take on a number from 0 to 255.
We have a history of approximately 6 months of values, for a total of over 2000 blocks of data.

We consider a set of 65 sequential blocks of data as Epoch, and consider the next block as Future Block. We select the Epoch blocks that do not contain the values of the Future Block. Of these data blocks, we generate a distinct set of values. If we exclude this distinct set from the set of possible values, i.e. from 0 to 255, we obtain a reduced set (approximately 30 to 40 values) which certainly contain the values of the Future Block.

If we then consider that the data Epochs will be sequential with a step of only 1 data block (therefore 0-64, 1-65, 2-66, etc.), the previous consideration is always valid.

Now, we have difficulty creating a model capable of analyzing the data blocks, indicating which blocks to “discard”, and then obtaining a reduced set of possible values.

Could you help us define this model?

Thanks in advantage

Someone can help us on this project?

Hi @klode82 Welcome to Tensorflow forum ,

Based on the information provided, it seems like you’re dealing with a sequence-to-sequence prediction problem where you want to predict the next block of data given a sequence of historical blocks. You also want to identify and discard certain blocks from the historical data to obtain a reduced set of possible values for the next block.

Here’s a basic code structure to define and train the model

from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense

# Define your model
model = Sequential([
    LSTM(64, input_shape=(65, 12)),  # Input shape: (sequence_length, num_features)
    Dense(256, activation='relu'),     # Adjust units based on your reduced set of possible values
    Dense(128, activation='relu'),
    Dense(40, activation='softmax')    # Output layer with softmax activation for 40 possible values

# Compile the model
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

# Train the model
history =, y_train, epochs=10, validation_data=(X_val, y_val))

# Evaluate the model
loss, accuracy = model.evaluate(X_test, y_test)

In this code:

  • X_train, y_train, X_val, y_val, X_test, and y_test are your training, validation, and test data splits.
  • Adjust the architecture and hyperparameters (e.g., LSTM units, Dense layer sizes, optimizer, etc.) based on your specific requirements and the characteristics of your data.
  • Ensure that your data is properly formatted and encoded for training with the model (e.g., one-hot encoding for categorical labels).

Thank You !