Questions tagged [triplet]
63 questions
0
votes
0 answers
Implementing Finetuning and Triplet Networks in n-shot Learning
I am currently working on an n-shot learning project, and I have a few questions regarding the implementation of finetuning and triplet networks within the context of n-shot learning.
Can finetuning and triplet networks be applied in n-shot learning…

Fahmida Afrin
- 21
- 2
0
votes
0 answers
Feeding data into a Siamese Network
For my project I have decided to use a CNN with triplet loss for feature embedding. I have preprocessed my data to create 72xframes windows, I have defined functions that get me batches thereof with an anchor, positive and negative image and I am…

Tria Ufo
- 1
0
votes
2 answers
How to change the default batch size of Keras layers when compiling a model?
I have a simple model in Keras 2.8.0 that takes a batch of images and outputs the pairwise distance of their embeddings:
inp = layers.Input((28, 28, 1))
x = layers.Conv2D(64, (3, 3), padding='same')(inp)
x = layers.MaxPooling2D()(x)
x =…

Jenia Golbstein
- 374
- 2
- 12
0
votes
2 answers
How can I iterate (loop) over i, j values in order?
I have this code to find Pythagorean triplets:
for i in range(1,31):
for j in range(1,31):
for k in range(1,31):
if((i**2 + j**2)==(k**2)):
print(i,",",j,",",k)
I get this result:
3 , 4 , 5
4 , 3 , 5
5 , 12 ,…

Nishit Barbhaya
- 9
- 1
0
votes
0 answers
Problem with tensor shape when implementing a custom loss function for my model in Tensorflow
I picked up the idea of triplet loss and global orthogonal regularization from this paper http://cs230.stanford.edu/projects_fall_2019/reports/26251543.pdf. However, I keep getting caught up in an tensor shape error.
After I define modelv1 as the…

Frey
- 1
- 1
0
votes
0 answers
Triplet Loss model not getting any result Siamese Model
I have been trying to build a Siamese model using the Triplet Loss addon by Tensorflow (this tries to, working in a batch of anchor, positive(same person) and negative(other person), minimize the distance between faces of identical identity and…

jaimerc
- 1
- 3
0
votes
0 answers
Triplet networks using keras for RNN
I am trying to write a custom loss function for triplet loss(using keras), which takes 3 arguments anchor,positive and negative. The triplets are generated using gru layer and the arguments for model.fit is provided through data generators.
The…
0
votes
2 answers
Debug errors from my triplet sum from an array code from C++
I was tring a codingninjas problem, while executing got only 1 test case satisfied, please help.
Given a random integer array and a number x. Find and print the triplets of elements in the array which sum to x.
While printing a triplet, print the…

Praneet Debnath
- 3
- 3
0
votes
0 answers
Store a list of triplet with constant look up
I would like to store a list of triplets of Enums- say List<> where I should be able to look up by any of the fields. What I mean is, say I store something like,
List<> list;
list[0] = [ObjectOfEnum1,…

codeworks
- 149
- 1
- 15
0
votes
0 answers
ValueError: Shape must be rank 2 but is rank 1 for 'loss/dense_2_loss/Npairloss/MatMul' (op: 'MatMul') with input shapes: [?], [?,10]
The error
ValueError: Shape must be rank 2 but is rank 1 for 'loss/dense_2_loss/Npairloss/MatMul' (op: 'MatMul') with input shapes: [?], [?,10].
def Npairloss(y_true,y_pred):
l2_reg = 0.02
anchors = y_pred[:,0] # (n,…

user12204435
- 59
- 2
- 6
0
votes
1 answer
Random triplet number generator
I would like to create code for a random number generator for predetermined sets of triplets (200 sets in total to randomize). I would like the sets of triplets to form a set of six numbers and the set of triplets to remain unique.
example triplets…
0
votes
4 answers
Three numbers in an array that sum up to a target sum in O(n)
Recently hashedin asked the triplet sum problem where three numbers are supposed to add up to a target sum. They said to do it in O(n).
I have tried doing it in O(n^2). First, i sorted the array and then for searching the combination i had to apply…

Joystick
- 286
- 1
- 12
0
votes
1 answer
How to find most frequent triplet of integers?
I have a class containing 3 integers: r,g,b. I make table of 50 objects to that class. How to find most frequent triplet?
I made arrays of every value r,g,b. Then I sorted them and found most frequent value of each array.

Ann G
- 1
0
votes
1 answer
Correctly submitting 3 inputs to a Keras model based on Triplet Loss
I'm working on a model consisting in 2 parts, as i discussed in this question: the first should take the elements of a triplet (consisting in an anchor, a positive example and a negative example, same principle adopted in FaceNet) and turn them into…

m.i.n.a.r.
- 922
- 2
- 12
- 28
0
votes
0 answers
Triplet loss on text embeddings with keras
I'd start saying i'm quite new to Keras and machine learning in general. I'm trying to build an "experimental" model consisting of two parts:
An "encoder" which takes a string (containing a long series of attributes, i'm using the DBLP-ACM…

m.i.n.a.r.
- 922
- 2
- 12
- 28