I asked this question on stack overflow and was told that this is a better place for it.
I am confused with the terms validation and testing, is validating the model same as testing it? is it possible to use testing data for validation?
what even confuses me more is that when to use validation? is it a necessary step for the model? also is it possible to do validation instead of testing?
also can the training data be the same as the validation data?
also can you tell if this code does testing? it is really confusing me
model.fit_generator(
training_gen(1000,25),
steps_per_epoch=50,
epochs=10000,
validation_data=validation_gen(1000, 25),
validation_steps=1,
callbacks=[checkpoint],
verbose=2)
model.load_weights('./temp_trained_25.h5')
BER = []
for SNR in range(5, 30, 5):
y = model.evaluate(
validation_gen(10000, SNR),
steps=1
)
BER.append(y[1])
print(y)
print(BER)
noting that training_gen and validation_gen are:
def training_gen(bs, SNRdb = 20):
while True:
index = np.random.choice(np.arange(train_size), size=bs)
H_total = channel_train[index]
input_samples = []
input_labels = []
for H in H_total:
bits = np.random.binomial(n=1, p=0.5, size=(payloadBits_per_OFDM,))
signal_output, para = ofdm_simulate(bits, H, SNRdb)
input_labels.append(bits[0:16])
input_samples.append(signal_output)
yield (np.asarray(input_samples), np.asarray(input_labels))
def validation_gen(bs, SNRdb = 20):
while True:
index = np.random.choice(np.arange(train_size), size=bs)
H_total = channel_train[index]
input_samples = []
input_labels = []
for H in H_total:
bits = np.random.binomial(n=1, p=0.5, size=(payloadBits_per_OFDM,))
signal_output, para = ofdm_simulate(bits, H, SNRdb)
input_labels.append(bits[0:16])
input_samples.append(signal_output)
yield (np.asarray(input_samples), np.asarray(input_labels))
I'm quite new to deep learning and it seems like everything confuses me, sorry if my questions seems dump and unreasonable but please if you can help me to figure out this confusion I would be thankful.
Thanks in advance!