Questions tagged [vector-space]

20 questions
7
votes
2 answers

Is there any reason to (not) L2-normalize vectors before using cosine similarity?

I was reading the paper "Improving Distributional Similarity with Lessons Learned from Word Embeddings" by Levy et al., and while discussing their hyperparameters, they say: Vector Normalization (nrm) As mentioned in Section 2, all vectors (i.e.…
user3554004
  • 1,044
  • 9
  • 24
6
votes
2 answers

Three.js - How to Pivot Camera around a Vector3 point?

Ok, I will try and be as concise as possible. I am not very good with math and what might seem obvious to you will most likely be rocket science to me. I am using Three.js w/CSS3DRenderer to create a virtual gallery space. I need a first person…
pandakub
  • 61
  • 1
  • 4
5
votes
1 answer

Does atan2 required normalized vectors? Which is better to use acos or atan for angles between vectors?

When calculating the angle between two vectors, I have traditionally used acos, but this requires the two vectors to be normalised. atan2 can be used to accomplish the same (specifically atan2(b.y_, b.x_) - atan2(a.y_, a.x_)), does this require…
lfgtm
  • 1,037
  • 6
  • 19
4
votes
1 answer

How to manually change the vector dimensions of a word in Gensim Word2Vec

I have a Word2Vec model with a lot of word vectors. I can access a word vector as so. word_vectors = gensim.models.Word2Vec.load(wordspace_path) print(word_vectors['boy']) Output [ -5.48055351e-01 1.08748421e-01 -3.50534245e-02 …
Saurav Mukherjee
  • 177
  • 1
  • 16
2
votes
1 answer

How do I subtract and add vectors with gensim KeyedVectors?

I need to add and subtract word vectors, for a project in which I use gensim.models.KeyedVectors (from the word2vec-google-news-300 model) Unfortunately, I've tried but can't manage to do it correctly. Let's look at the poular example queen ~= king…
sthorm
  • 23
  • 7
2
votes
0 answers

Implement a mathematical vector in C++ reusing containers of the standard library

This question is motivated by the following implementation of the Runge Kutta formula for integration of first order ordinary differential equations (ODE). template auto runge_kutta(const Vector& y, …
2
votes
1 answer

Why we need bigger vector space for displaying relations in word embedding models?

I’m working on word embeddings and a little bit confused about number of word vector's dimensions. I mean, take word2vec as an example, my question is why we should use lets say 100 hidden neurons for our hidden layer? Does this number have any…
1
vote
2 answers

Sparse vector space of degree 3 and dimension 1

I'm trying to do some computations involving Lie algebras on SAGE, but I'm not understanding much of the terminology. When I ask it to describe a certain module over the Lie algebra, it tells me it's a "Sparse vector space of degree 3 and dimension…
A.D.
  • 13
  • 3
1
vote
1 answer

Programmatical Change of basis for coordinate vectors with different origin of coordinates (python/general maths)

I have a Support Vector Machine that splits my data in two using a decision hyperplane (for visualisation purposes this is a sample dataset with three dimensions), like this: Now I want to perform a change of basis, such that the hyperplane lies…
Chris Stenkamp
  • 337
  • 1
  • 2
  • 15
1
vote
0 answers

Storing TF-IDF values in an inverted index

I'm creating a search engine to search a list of roughly 20k English phrases, each one being a few words long. I've looked into ways to create the search engine, and currently I am using a TfidfVectorizer from sklearn and Cosine Similarity to…
1
vote
0 answers

similarity measures in vector space model

If I have two vectors represent two sentences contains Tf-IDF weights as following: v1 = [0.23,0.44,0.95,0.13] v2 = [0.73,0.04,0.85,0.13] The traditional (scientific) measure is cosine similarity to measure similarity between them, are there other…
Minions
  • 5,104
  • 5
  • 50
  • 91
1
vote
1 answer

Indexing documents only with numeric fields in elasticsearch

I am trying to store objects in elasticsearch which are represented by only numeric fields. IN my case each object has 300 float fields and 1 id fields. I have put the id field as not_analyzed. I am able to store the documents in ES. "_index":…
ayush singhal
  • 1,879
  • 2
  • 18
  • 33
1
vote
1 answer

How to represent a basis of vectors in Matlab?

I'm creating a function which given two basis for a vector space, it returns the change of basis matrix from one basis to the other. The problem is that I don't know how to represent a basis. A basis is basically a set (where duplicates are not…
nbro
  • 15,395
  • 32
  • 113
  • 196
0
votes
1 answer

How to plot a line in 3 dimensional space with matplotlib

I have two 3D-points, for example a = (100, 100, 10) and b = (0, 100, 60), and would like to fit a line through those points. I know, the 3D line equation can have different shapes: Vector-form: (x,y,z)=(x0,y0,z0)+t(a,b,c) Parameter-form:…
0
votes
1 answer

Matrix of Linear Transformation

Find a matrix for the Linear Transformation T: R2 → R3, defined by T (x, y) = (13x - 9y, -x - 2y, -11x - 6y) with respect to the basis B = {(2, 3), (-3, -4)} and C = {(-1, 2, 2), (-4, 1, 3), (1, -1, -1)} for R2 & R3 respectively. Here, the process…
1
2