128 questions
0
votes
1
answer
347
views
From keras 2 to keras 3 conversion of notebook
as the title suggests, I'm trying to convert a notebook in keras 3, but idk why it's not working properly.
This is the original notebook (tell me if it's better to put here the code), I'm trying to do ...
0
votes
1
answer
85
views
Fast AI Siamese model not improving
So I was following this tutorial: Fast Ai Siamese, however after I completed it, I got 50% accuracy. I tried loads of things, but nothing worked. So the only place where I think the problem could be ...
0
votes
0
answers
191
views
PYTHON: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
I'am enable to run my code via Python. The main problem of it is that, the error is plotting "Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)". Is the problem from my ...
1
vote
0
answers
357
views
How to train a Siamese Network with triplet loss using tfa.losses.TripletSemiHardLoss?
I intend to train a siamese neural network with triplet loss using semi-hard triplet mining technique.
However, I am pretty confused of how tfa.losses.TripletSemiHardLoss() do the tricks.
I've already ...
1
vote
0
answers
82
views
Vector collapse with batch hard triplet mining (Siamese Network)
I am having this problem for a long time while trying to recreate this paper's https://arxiv.org/pdf/1703.07737 implementation in tensorflow 2.10.0.
The problem is when i apply the same loss and data ...
2
votes
1
answer
133
views
Pytorch Siamese Network implementation?
I tried to implement the siamese network for image classification task according to the code below:
class SiameseNetwork(nn.Module):
def __init__(self):
super(SiameseNetwork, self)....
1
vote
1
answer
305
views
Does one-shot-learning by definition allow to have only one training instance per class and would this be even feasible?
I am confused by the different interpretations of one-shot-learning found on the Internet. Wikipedia claims that "one-shot learning aims to classify objects from one, or only a few, examples"...
0
votes
1
answer
263
views
Set the range of pairwise distance and cosine similarity between 0 and 1
I write a BiLSTM-Siamese Network to measure the string similarities using pairwise distance and cosine similarities with the detail as follows:
class SiameseNetwork(nn.Module):
def __init__(self, ...
0
votes
0
answers
71
views
Problem with keras.Dense. The last dimension of the inputs to a Dense layer should be defined. Found None. Full input shape received: (None, None)
I wrote some python code to develop a siamese network. The sub-clase from keras.Model is:
class modelSIAMESE(keras.Model):
def init(self):
super().init()
input_shape = target_shape + (3,)
input_a = ...
0
votes
1
answer
105
views
create an efficient dataset to feed a keras siamese model
I need help to build a generator for a Siamese model in Keras and Tensorflow. I succeeded in creating a python generator but it resulted too slow for my purposes. My idea was to use Tensorflow ...
1
vote
2
answers
1k
views
Finetune Sentence Transformer using Huggingface Trainer API
I want to fine tune a Sentence Transformer (For example MPNET) using Contrastive Learning. Is it possible to use the Huggingface Trainer API for this? If yes, how? Can you kindly guide me with some ...
2
votes
1
answer
2k
views
Spot the Difference between two images using AI
I'm looking for a method to Spot the difference between two images using AI.
It's my university project, that my professor asked me to create a program to detect and spot the differences in two pairs ...
1
vote
0
answers
56
views
When training with MAML and Siamese networks, I've encountered issues where the weights aren't updating or the accuracy remains unchanged
I want to train a model for subjective question scoring using ALBERT and a Siamese network, which consists of a bidirectional LSTM and a fully connected layer. During training, I've noticed that the ...
0
votes
0
answers
110
views
Pytorch siamese model using lstm
I am building a siamese model using Lstm, I have trained and tested the model but I condn’t inference it on sigle sample
Here’s the model
class SiameseLstm(nn.Module):
def __init__(self):
...
0
votes
0
answers
46
views
Tensorflow Incompatible shapes: [16,48] vs. [0]
I have the following code portion for a siamese network
def build_sequential_model(input_shape, embedding_dim=16):
model = Sequential()
model.add(Input(shape=(input_shape,)))
model.add(...