Questions tagged [vectorization]
Vectorization refers to a programming paradigm where functions operate on whole arrays in one go. This affords benefits in terms of function calls, memory access, parallelization and code expressiveness. Some programming languages, such as MATLAB, are optimised to give the best performance when vectorized.
vectorization
6,768
questions
0
votes
0
answers
37
views
Vectorization of power law fitting
I am moving a code base to run using PyTorch tensor on GPU. For loops are terrible on GPU especially for small-sized data. I am trying to vectorize the function below, i.e. to have no for loops.
I ...
-1
votes
0
answers
18
views
Getting this error 'SegmentAPI' object has no attribute 'close'
I am using cromadb for vectorization in my flask application.
below is my vectordb.py code:-
import os
import shutil
from dotenv import load_dotenv
load_dotenv()
import re
from llama_index import (
...
0
votes
2
answers
56
views
Vectorize a sampling of a dataframe based on filtered conditions?
I have two dataframes, one which has three variables (one discrete, two continuous) and the other which has the same, except with also an additional 4th variable. For the purposes of a minimum ...
0
votes
0
answers
25
views
TypeError while executing Langchain RunnablePassThrough. Question is not passed correctly
I get this error message
<ipython-input-141-b8110c573881> in <cell line: 1>()
----> 1 final_chain.invoke({"question":"Count of Agencies?"})
25 frames
/usr/local/lib/...
1
vote
0
answers
29
views
Optimizing pgvector for multi-user document storage: Best practices for indexing and partitioning
I'm using PostgreSQL with pgvector and LangChain for document storage and retrieval. My setup:
Many users, each uploading multiple documents
Documents have metadata with userId
Need to isolate user ...
0
votes
1
answer
45
views
Julia: Easiest and efficient way to check if each element of a vector is in another list? .∈ doesn't seem to work
In Julia, assuming I have a vector and a list of candidates:
x = [1, 2, 3, 4, 5]
targetlist = [1, 2]
I would like to iteratively check for each element of the vector if it is contained in the target ...
1
vote
1
answer
65
views
Python for loop numpy vectorization
Do you have any suggestions how I can speed up the "f_img_update" function in the code below? I tried adding numba @jit decorator, but without luck. I guess that numpy vectorization might ...
1
vote
0
answers
61
views
How do I persist FAISS indexes?
In the langchain wiki of FAISS, https://python.langchain.com/v0.2/docs/integrations/vectorstores/faiss/, it only talks about saving indexes to files.
db.save_local("faiss_index")
new_db = ...
4
votes
1
answer
76
views
How to vectorize groupby combination lists of two columns in Pandas Dataframe
I've a dataframe and need to group by two columns from all possible combinations of dataframe columns ['A','B','C','D','E','F','G']
import pandas as pd
d = {'A': [0,1,1,0,0,1,0,0],
'B': [1,1,0,0,...
-2
votes
1
answer
70
views
How to set values in a dataframe column that depends if another column value is bigger than a dict/lookup table
I have a dataset with date and id columns, and I want to set a third column 'Status' where if the date is before the value in the dict/lookup table, then 'On', 'Off' if on or after the date.
For ...
-1
votes
0
answers
27
views
Training Neural Network for Image-Text Relevance with Expert Scores
I have two datasets:
The first contains 768-dimensional image embeddings generated by a modified ResNet18 model. The final fully connected layer is removed to obtain feature representations instead ...
1
vote
1
answer
63
views
RVV type for a class member in C++
I would like to use RISC-V vector extension in my C++ application.
I noticed that it is not possible to use RVV types (e.g., "vuint32m1_t") for class members. Compiling with gcc (v13.2.0), I ...
0
votes
1
answer
42
views
Add pagenumber to azure search index fields
I am using Azure Integrated vectorization for our document extraction and wondering if there is a way that I can add original page number which chunk belongs to it. This will help when we show the ...
2
votes
1
answer
51
views
Vectorize a "shrinking" scalar product in MATLAB
Say I am given a row vector psi of length P and a row vector q of length M in MATLAB. Here, M>P. I want to assemble G in the following way:
for j = 1:M
G(j) = q(j:min(j+P-1, M))*psi(1:min(M-...
1
vote
1
answer
57
views
Numpy for loop vectorization - points, triangles, area, volume calculation
I have two numpy arrays - one containing coordinates of 3D points and the second with triangles composed from those points. I need to calculate top surface 2D area and volume of this triangles (...