Any algorithm that uses data (in some form) to improve some performance measure (aka objective function), or to find some function, can be considered a machine learning algorithm. See this answer for more complete definitions of ML.
k-means does that. It uses the data to find some division of the data itself into groups, in order to maximize some objective ...
Given arange returns a 1-D tensor with values from 0 to logits.shape, then the labels is a vector of $0$ to $N$ where $N$ is the number of classes predicted by the output layer of f_q.
The CrossEntropyLoss then finds the difference between the predictions and the target labels, which the encoder weights f_q.params is updated according to. I haven't read ...
So, I've prepared some data that resembles your sketch:
n , u = np.random.normal , np.random.uniform
x = np.concatenate([ n(1.0,0.2,100), n(3.0,0.3,100), u(0,10.0,100)])
y = np.concatenate([ n(7.0,0.4,100), n(5.0,0.3,100), u(0,10.0,100)])
# lets shuffle it a bit
idx = np.arange(x.shape)
data = np.array([x,y])[:,idx]
And then I just ...
After a lot of searches, I think self-taught learning is a Transfer learning category, I think when Self-taught learning paper published (2007), there isn't any good survey on transfer learning, and as seen by high citation of the paper of Pan, his paper (which published in 2009) describes transfer learning in a clear way that did not exist before it.
You should first segregate the rejected samples. You can use then use string matching or something more complex (like creating embeddings and then, taking L2 distance between them) between the different field names you have and the comment for rejection. Whichever field gets the highest score, you increase the rejection count for that field. In the end, you ...
I shall suggest one more popular metric for this. Davies Bouldin Score (https://scikit-learn.org/stable/modules/generated/sklearn.metrics.davies_bouldin_score.html#sklearn.metrics.davies_bouldin_score).
You can also take a look at the clustering metrics in scikit documentation (https://scikit-learn.org/stable/modules/classes.html#module-sklearn.metrics).
You can compute "Silhouette Coefficient" for your aim. Its values mean:
1: Means clusters are well apart from each other and clearly distinguished.
0: Means clusters are indifferent, or we can say that the distance between clusters is not significant.
-1: Means clusters are assigned in the wrong way.
Also other measures such as purity and mutual ...