пример пары строк данных ({"SourceHostname_User": "director\\TestoedovNA", "EventId": 0.0, "ThreadId": 0.0, "Image": 0.6666666666666666, "UtcTime": "2023-12-04 04:21:08.721", "Class": 1}
{"SourceHostname_User": "director\\TestoedovNA", "EventId": 0.0, "ThreadId": 0.0, "Image": 1.0, "UtcTime": "2023-12-04 04:21:08.851", "Class": 1}
{"SourceHostname_User": "director\\TestoedovNA", "EventId": 0.0, "ThreadId": 0.0, "Image": 1.0, "UtcTime": "2023-12-04 04:21:11.056", "Class": 1}
{"SourceHostname_User": "n764265.iss-reshetnev.ru", "EventId": 0.16666666666666669, "ThreadId": 0.9999999999999996, "Image": 0.3333333333333333, "UtcTime": "2023-12-04 01:17:33.720", "Class": 0}
{"SourceHostname_User": "n764265.iss-reshetnev.ru", "EventId": 0.16666666666666669, "ThreadId": 0.9999999999999996, "Image": 0.3333333333333333, "UtcTime": "2023-12-04 01:17:33.787", "Class": 0})  код обучения(input_file_name = '34.jsonl'

class DataGenerator(Sequence):
    def __init__(self, filename, batch_size, n_classes, shuffle=False):
        self.filename = filename
        self.batch_size = batch_size
        self.n_classes = n_classes
        self.shuffle = shuffle
        self.data = self._load_data()  # Load and process data on initialization
        self.on_epoch_end()

    def _load_data(self):
        director_data, loganov_data = [], []
        with open(self.filename, 'r', encoding='utf-8') as file:
            for line in file:
                data = json.loads(line)
                if 'director\\TestoedovNA' in data['SourceHostname_User']:
                    director_data.append(data)
                elif data['SourceHostname_User'] == 'n764265.iss-reshetnev.ru':
                    loganov_data.append(data)
        return {
            'director\\TestoedovNA': director_data,
            'n764265.iss-reshetnev.ru': loganov_data
        }

    def on_epoch_end(self):
        if self.shuffle:
            np.random.shuffle(self.data['director\\TestoedovNA'])
            np.random.shuffle(self.data['n764265.iss-reshetnev.ru'])

    def __len__(self):
        return min(len(self.data['director\\TestoedovNA']), len(self.data['n764265.iss-reshetnev.ru'])) // (self.batch_size // 2)

    def __getitem__(self, index):
        x = np.zeros((self.batch_size, 100, 3))
        y = np.zeros((self.batch_size), dtype=int)

        half_batch = self.batch_size // 2
        director_index = index * half_batch
        loganov_index = index * half_batch
        for i in range(half_batch):
            data = self.data['director\\TestoedovNA'][director_index + i]
            x[i] = np.array([data['EventId'], data['ThreadId'], data['Image']])[:100]
            y[i] = data['Class']

            data = self.data['n764265.iss-reshetnev.ru'][loganov_index + i]
            x[i + half_batch] = np.array([data['EventId'], data['ThreadId'], data['Image']])[:100]
            y[i + half_batch] = data['Class']

        return x, tf.keras.utils.to_categorical(y, num_classes=self.n_classes)


n_features = 3  
sequence_length = 100  
n_classes = 2  

model = Sequential([
    GRU(100, return_sequences=True, input_shape=(sequence_length, n_features)),
    GRU(128, return_sequences=False),  
    Dense(n_classes, activation="relu") 
])

model.compile(optimizer="adam", loss="categorical_crossentropy", metrics=["accuracy"])

train_generator = DataGenerator(filename=input_file_name, batch_size=100, n_classes=n_classes)

model.fit(train_generator, epochs=1)

model.save("neural_network_model.h5")
) найди и испраавь ошибки