Skip to content

How do we run the test dataset in the temporal ConvNet? #11

Description

for chunk in chunks(keys,chunk_size):
if flag<1:
print("Preparing testing data...")
X_test,Y_test=getTrainData(chunk,nb_classes,img_rows,img_cols)
flag+=1
continue
print instance_count
instance_count+=chunk_size
X_batch,Y_batch=getTrainData(chunk,nb_classes,img_rows,img_cols)
if (X_batch!=None and Y_batch!=None):
loss = model.fit(X_batch, Y_batch, verbose=1, batch_size=batch_size, nb_epoch=1, show_accuracy=True)
if instance_count%256==0:
loss = model.evaluate(X_test,Y_test,batch_size=batch_size,verbose=1)
preds = model.predict(X_test)
print (preds)
print ('-'*40)
print (Y_test)
comparisons=[]
maximum=np.argmax(Y_test,axis=1)
for i,j in enumerate(maximum):
comparisons.append(preds[i][j])
with open('compare.txt','a') as f1:
f1.write(str(comparisons))
f1.write('\n\n')
with open('loss.txt','a') as f1:
f1.write(str(loss))
f1.write('\n')
model.save_weights('temporal_stream_model.h5',overwrite=True)

So is the code which running the testing part of the code ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions