Earlier quoted context omitted.
Because op knows TS and doesn't know Rust?
What I'm asking really is what is the benefit of TS if we could use decent and improving coding AIs to help us code in Rust, even if we are new to it, or never used it, and compile to WASM. Much faster execution per my experience. I mean not even comparable.
How to Implement a Cosine Similarity Function in TypeScript
31–40 of 43 posts
Re: How to Implement a Cosine Similarity Function in TypeScript
#32As a physicist, I always found it funny that in ML people renamed 'the angle between vectors' into something as fancy-feeling as 'cosine similarity'.
I think the point is they're often doing it on things that aren't strictly vectors by definition, as in the physics sense, rather just some sack of stuff organised like they might be a vector and assuming its valid to compare angles because its just something numerically without much bias that does the job.
Re: How to Implement a Cosine Similarity Function in TypeScript
#33As a physicist, I always found it funny that in ML people renamed 'the angle between vectors' into something as fancy-feeling as 'cosine similarity'.
I think the point is they're often doing it on things that aren't strictly vectors by definition, as in the physics sense, rather just some sack of stuff organised like they might be a vector and assuming its valid to compare angles because its just something numerically without much bias that does the job.
Re: How to Implement a Cosine Similarity Function in TypeScript
#34It’s a nice post, but “using array methods” probably shouldn’t be placed in the “Efficient Implementation” section. As often happens with high-level languages, a single plain old loop is faster than three array methods. Similarly, if you plan to query those vectors in search, you should consider continuous `TypedArray` types and smaller scalars than the double precision `number`. I know very little about JS, but some…
ooh, fantastic.. thankyou ! Im doing a bunch of 3D rotation transforms on millions of points in javascript .. this looks like what I need.
Re: How to Implement a Cosine Similarity Function in TypeScript
#35Re: How to Implement a Cosine Similarity Function in TypeScript
#36As a physicist, I always found it funny that in ML people renamed 'the angle between vectors' into something as fancy-feeling as 'cosine similarity'.
And I think today it is preferred to call it "similarity" instead of "distance" because it is not a true distance function (15 years ago we called it "cosine distance").
Re: How to Implement a Cosine Similarity Function in TypeScript
#37Great post, but what struck me (again, like every time I look at cos similiarity) is how unreasonably well it works. It's just one of those things that's so "weird" about our world: why would cosine similarity work in n-dimensional semantic spaces? It's so stupid simple, and it intuitively makes sense, and it works really well. Crazy cool. I'm reminded of that old Eugene Wigner quote: "The most incomprehensible thing…
Re: How to Implement a Cosine Similarity Function in TypeScript
#38Re: How to Implement a Cosine Similarity Function in TypeScript
#39As a physicist, I always found it funny that in ML people renamed 'the angle between vectors' into something as fancy-feeling as 'cosine similarity'.
As an engineer I find it funny when physicists (and general ML bros) don't know about linear algebra concepts
Re: How to Implement a Cosine Similarity Function in TypeScript
#40Earlier quoted context omitted.
As an engineer I find it funny when physicists (and general ML bros) don't know about linear algebra concepts
huh? This is just a funny joke on the way its named, what made you think I don't know about dot products ?
> in ML people renamed 'the angle between vectors' into something as fancy-feeling as 'cosine similarity'.
Since cosine similarity is a name derived from linear algebra