import os
import re
import shutil
import numpy as np
import tensorflow as tf
import keras
from keras import layers
from keras.callbacks import Callback
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.utils import class_weight
import math
import matplotlib.pyplot as plt
np.random.seed(0)
tf.random.set_seed(0)
print('TensorFlow version:', tf.__version__)
print('NumPy version:', np.__version__)
def print_model_summary(model):
print('Model summary:')
model.summary()
with open('model_summary.txt', 'w') as f:
model.summary(print_fn=lambda x: f.write(x + '\n'))
print('Model summary has been saved to model_summary.txt')