def calculate_loss(self): x = self.get_input_sequences() preds = self.calculate_outputs(x) loss = sequence_log_loss(self.next_is_ordered, preds, self.history_length, 100) return loss