Esempio n. 1
0
from keras import optimizers, losses, metrics
from preprocessing import Preprocessing
from simulation import Simulation
from spp import R2
import numpy as np
import matplotlib.pyplot as plt

# Parameters setting
num_of_cells = 2
num_of_CUEs = 2
num_of_D2Ds = 2
batch_size = 64
epochs = 8

# Get the image data format which Keras follows
image_data_format = Preprocessing.GetImageDataFormat()

# Get the input data and target data
input_data = Preprocessing.GetInputData(num_of_cells, num_of_CUEs, num_of_D2Ds,
                                        (2000, 8000, 10000), image_data_format)
target_data = Preprocessing.GetTargetData(num_of_cells, num_of_CUEs,
                                          num_of_D2Ds, (2000, 8000, 10000))

# Reshape the input data
rows, cols, channels = Preprocessing.GetInputShape(input_data)
reshaped_input_data = Preprocessing.ReshapeInputData3D(input_data,
                                                       image_data_format, rows,
                                                       cols * channels, 1)

# Split the datadset into the training set and testing set
(x_train, y_train), (x_test,