예제 #1
0
image_data_format = Preprocessing.GetImageDataFormat()

# Get the input data and target data
input_data_list = [
    Preprocessing.GetInputData(num_of_cells, num_of_CUEs, i,
                               (2000, 8000, 10000), image_data_format)
    for i in num_of_D2Ds
]
target_data_list = [
    Preprocessing.GetTargetData(num_of_cells, num_of_CUEs, i,
                                (2000, 8000, 10000)) for i in num_of_D2Ds
]

# Reshape the input data
for index, input_data in enumerate(input_data_list):
    rows, cols, channels = Preprocessing.GetInputShape(input_data)
    input_data_list[index] = Preprocessing.ReshapeInputData3D(
        input_data, image_data_format, rows, cols * channels, 1)

# Get the maximum length of the target data in the target data list
max_length = Preprocessing.GetMaxLength(target_data_list)

# Zero padding
for index, target_data in enumerate(target_data_list):
    target_data_list[index] = Preprocessing.ZeroPadding(
        target_data, max_length)

# Split the datadset into the training set and testing set
x_train_list, y_train_list, x_test_list, y_test_list = [[None] *
                                                        len(input_data_list)
                                                        for _ in range(4)]
예제 #2
0
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,
                     y_test) = Preprocessing.SplitDataset(reshaped_input_data,
                                                          target_data,
                                                          proportion=0.8,
                                                          shuffle=False)

# Get the input shape of input data and the output shape of target data
input_shape = Preprocessing.GetInputShape(x_train)
target_shape = Preprocessing.GetTargetShape(y_train)
예제 #3
0
                                        (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
reshaped_input_data = Preprocessing.ReshapeInputData1D(input_data)

# Split the datadset into the training set and testing set
(x_train, y_train), (x_test,
                     y_test) = Preprocessing.SplitDataset(reshaped_input_data,
                                                          target_data,
                                                          proportion=0.8,
                                                          shuffle=False)

# Get the input shape of input data and the output shape of target data
input_shape = Preprocessing.GetInputShape(x_train)
target_shape = Preprocessing.GetTargetShape(y_train)

# Build the model
model = Sequential()

model.add(Dense(units=512, activation='relu', input_shape=input_shape))

model.add(Dense(units=512, activation='relu'))

model.add(Dense(units=512, activation='relu'))

model.add(Dense(units=512, activation='relu'))

model.add(Dense(units=target_shape, activation='linear'))