Learn practical skills, build real-world projects, and advance your career
Created 4 years ago
Evaluate a Siamese model: Ungraded Lecture Notebook
import trax.fastmath.numpy as np
INFO:tensorflow:tokens_length=568 inputs_length=512 targets_length=114 noise_density=0.15 mean_noise_span_length=3.0
Inspecting the necessary elements
In this lecture notebook you will learn how to evaluate a Siamese model using the accuracy metric. Because there are many steps before evaluating a Siamese network (as you will see in this week's assignment) the necessary elements and variables are replicated here using real data from the assignment:
q1
: vector with dimension(batch_size X max_length)
containing first questions to compare in the test set.q2
: vector with dimension(batch_size X max_length)
containing second questions to compare in the test set.
Notice that for each pair of vectors within a batch , is associated to .
-
y_test
: 1 if and are duplicates, 0 otherwise. -
v1
: output vector from the model's prediction associated with the first questions. -
v2
: output vector from the model's prediction associated with the second questions.
You can inspect each one of these variables by running the following cells: