text
stringlengths
81
47k
source
stringlengths
59
147
Question: <p>I found a methodology to use RAG (retrieval-augmented generation) with a Large Language Model (LLM) to answer question about a provided transcriptions. Here is the GitHub link: <a href="https://github.com/ingridstevens/whisper-audio-transcriber" rel="nofollow noreferrer">https://github.com/ingridstevens/wh...
https://stackoverflow.com/questions/78147781/connection-error-when-using-langchain-community-vectorstores-faiss-faiss
Question: <p>Context: I'm trying to implement an advanced RAG pipeline that uses <a href="https://docs.llamaindex.ai/en/latest/examples/retrievers/auto_merging_retriever.html" rel="nofollow noreferrer">Auto-merging Retriever</a> (aka <a href="https://python.langchain.com/docs/modules/data_connection/retrievers/parent_d...
https://stackoverflow.com/questions/77719901/how-can-i-implement-auto-merging-retriever-aka-parent-document-retriever-direc
Question: <p>I am implementing the example provided here: <a href="https://python.langchain.com/docs/templates/neo4j-advanced-rag" rel="nofollow noreferrer">https://python.langchain.com/docs/templates/neo4j-advanced-rag</a></p> <p>However, I'd like to enhance the functionality to return the sources (aka context) that w...
https://stackoverflow.com/questions/78072019/returning-document-sources-using-lcel
Question: <p><strong>Question:</strong></p> <p>I'm developing a chat application similar to ChatGPT using Azure's serverless model. The application includes several functionalities such as document upload, vector embeddings storage, and AI-powered responses. However, I'm facing multiple challenges and would appreciate ...
https://stackoverflow.com/questions/78917444/how-to-implement-chat-specific-vector-embeddings-and-manage-token-limits-in-a-se
Question: <p>I'm trying to build a Graph RAG with hybrid retrieval for technical documentation files. The answers need to be found for version specific documentation files. I'm trying to achieve this by filtering graph and vector queries based on file names. However, I'm unable to implement source file filtering for Gr...
https://stackoverflow.com/questions/78853538/how-to-filter-results-to-llm-from-graph-database-based-on-source-file-names
Question: <p>I am looking for a way to implement a RAG Chatbot which should keep the previous answer and questions from the current session in a short term memory and be able to answer followup question, I do not see anything from the documentation on how to implement that, I saw the chat engine documentation but saw n...
https://stackoverflow.com/questions/79085691/llamaindex-workflow-context-memory-management
Question: <p>Here's my issue:</p> <p>I was using Groq API with LLama 3.1 70B model to implement agentic RAG through LangGraph. For that, I had to install <code>langchain_groq</code> library. I installed the most updated one using <code>pip install -U langchain_groq</code>. Then I used the following code to load the mod...
https://stackoverflow.com/questions/78926872/langchain-error-groq-does-not-currently-support-tool-choice-any-should-be-o
Question: <p>i'm looking to create an ordered list (decimal) in which all the items are rag-left aligned with their numerical header. for example:</p> <blockquote> <blockquote> <p>List</p> <p>1.</p> <p>This is list item 1</p> <p>2.</p> <p>This is list item 2</p> <p>3....
https://stackoverflow.com/questions/32657851/css-ordered-list-in-single-vertical-column-above-list-item
Question: <p>I'm creating a RAG chatbot that uses the langchain and transformers libraries to generate responses to user queries using an LLM plugged into a vector index. The chatbot will live in a streamlit interface.</p> <p>I want to implement a way for the user to interrupt the LLM's <code>generate()</code> function...
https://stackoverflow.com/questions/78084171/is-there-a-way-to-interrupt-text-generation-in-an-transformers-llm-call
Question: <p>I am very new to JS I just created my very first web app but I am having trouble tidying up my code.</p> <p>My HTML has 3 range sliders I take the value from each and change the color of the thumb depending on that value (RAG). It works fine the way I have implemented it but I have repeated myself quite a ...
https://stackoverflow.com/questions/70411336/probably-a-really-simple-thing-but-i-cant-seem-to-pass-an-argument-into-my-java
Question: <p>I am implementing simple RAG using AzureOpenAI. It was working fine till I was directly using the OpenAIEmbeddings but when I deployed &quot;text-embedding-ada-002&quot; model on Azure and tried using the embeddings with that, it shows the error: 'str' object has no attribute 'create'</p> <pre><code>import...
https://stackoverflow.com/questions/78733721/openaiembeddings-works-fine-but-azureopenaiembeddings-gives-error-str-object
Question: <p>I am trying to build a RAG pipeline using <code>llama_index</code>. One of the first steps is to choose an embedding model that will be used for a <code>VectorStoreIndex</code>. My current implementation looks like this:</p> <pre class="lang-py prettyprint-override"><code>from llama_index.core import Setti...
https://stackoverflow.com/questions/78348493/llama-index-crashes-with-huggingfaceembedding
Question: <p>I am working on a RAG app, where I use LLMs to analyze various documents. I'm looking to improve the UX by streaming responses in real time.<br /> a snippet of my code:</p> <pre class="lang-py prettyprint-override"><code>params = SamplingParams(temperature=TEMPERATURE,                     min_tokens=1...
https://stackoverflow.com/questions/78815643/stream-output-using-vllm
Question: <p>I am new to Playwright, I am trying to implement Playwritght +NUnit framework. I currently facing 2 issues,</p> <p>a. When I have give any invalid locator (eg: xpath, cssselector), Playwright not throwing exception message, it's continue next step, even I try in try/catch block it not print exception.</p> ...
https://stackoverflow.com/questions/76750187/playwright-not-displaying-exception-when-locator-not-exists-in-dom
Question: <p>I am writing a RAG chatbot that retrieves information from a given list of documents. The documents can be found in a set folder, and they could be either .pdf or .docx. I want to merge all the documents using the same vector store, but I am running into trouble with the MergeDataLoader because any given f...
https://stackoverflow.com/questions/79370058/how-do-i-use-mergedataloader-to-tolerate-multiple-files-that-could-be-in-either
Question: <p>I am implementing RAG using azure AI search. I have created the index nd have 2605 document chunks in all to upload to the index. The peculiar behaviour that I have observed is :</p> <ol> <li>i cannot upload all 2605 chunks in one go.</li> <li>I try passing these in batch sizes of 600, by loooping over and...
https://stackoverflow.com/questions/78153996/uploading-documents-to-azure-ai-search
Question: <p>I'm working on a Gemini application where I need to make dynamic API calls based on user input. Specifically, I want to perform different API requests depending on the user's query. For example, if the user asks for the latest news, the application should make an API call to a news service. Similarly, if t...
https://stackoverflow.com/questions/78707861/how-to-make-dynamic-api-calls-based-on-user-input-in-a-gemini-application-python
Question: <p>I'm trying to run an LLM locally and feed it with the contents of a very large PDF. I have decided to try this via a RAG. For this I wanted to create a vectorstore, which contains the content of the pdf. however, I have a problem here when creating, which I can not solve, because I am still quite new in th...
https://stackoverflow.com/questions/79315980/problem-setting-up-a-faiss-vector-memory-in-python-with-embeddings
Question: <p>Im writing a crewAI backed by AWS Bedrock. application that generates code.</p> <p>The issue Im seeing is that it produces incomplete responses. The code produce some python functions but will</p> <ol> <li>Produce an incomplete function that is syntacticly incorrect.</li> <li>Produce not enough code to com...
https://stackoverflow.com/questions/78811050/why-does-bedrock-and-crewai-produce-incomplete-responses
Question: <p>I'm unable to <a href="https://docs.objectbox.io/faq#can-i-ship-my-app-with-a-pre-built-database" rel="nofollow noreferrer">ship my Flutter app with a pre-built database</a>. Below is my approach; <em><strong>it would be greatly appreciated if this intent of shipping a database and the steps involved are v...
https://stackoverflow.com/questions/79626120/unable-to-ship-my-flutter-app-with-a-pre-built-objectbox-database
Question: <p>I have RAG and am trying to implement filtering by keywords/phrases as shown below:</p> <pre><code> public SearchOptions? CreateSearchOptions( int searchTypeInt, int k, ReadOnlyMemory&lt;float&gt; embe...
https://stackoverflow.com/questions/77996066/azure-cognitive-search-filter-is-not-working
Question: <p>I want to know if there are any other settings required for pgvector or what content needs to be set in the code to enable pgvector to support higher vector dimensions. I found on the official website that pgvector can support vector dimensions up to 2000.The pgvector version is pgvector/pgvector:pg17</p> ...
https://stackoverflow.com/questions/79557012/i-am-using-langchain4j-to-develop-a-knowledge-base-and-encountered-the-differen
Question: <p>I'm currently implementing RAG on Azure using OpenAI and Azure AI Search, formerly known as Cognitive Services. I have around 50-65 JSON files that I need to search on my enterprise data. It turns out that in the referencing of the chatbot, I'm only getting the text &quot;citation&quot; and I'm trying to r...
https://stackoverflow.com/questions/78546836/azure-ai-search-fields-mapping-json-and-retrievable-fields
Question: <p>I'm implementing a RAG (Retrieval-Augmented Generation) system that requires combining traditional Django ORM filtering with vector similarity searches. The specific workflow needs to:</p> <p>First filter products by standard relational fields (e.g., category=&quot;books&quot;)</p> <p>Then perform vector s...
https://stackoverflow.com/questions/79569409/optimizing-django-orm-for-hybrid-queries-postgresql-vector-similarity-search
Question: <p>I am interested in understanding the logic behind the intent feature in the integration between OpenAI's chat completions and Azure AI Search. Specifically, I noticed that when appending and sending chat history for retrieval-augmented generation (RAG), there is a feature in the response named &quot;intent...
https://stackoverflow.com/questions/79007855/inquiry-about-intent-feature-in-openai-and-azure-ai-search-integration
Question: <p>I'm working on fine-tuning an LLM to build a fantasy football league model. The goal is to have the model output a team with high potential (hopefully) given a round of games. I have built an RAG dataset and implemented custom loss functions and metrics to fine-tune the model.</p> <p><strong>Problem</stron...
https://stackoverflow.com/questions/78949634/fine-tuning-llms-cuda-oom-errors-despite-various-optimization-techniques
Question: <p>I have implemented a Self Query retriever (<a href="https://python.langchain.com/docs/modules/data_connection/retrievers/self_query" rel="nofollow noreferrer">https://python.langchain.com/docs/modules/data_connection/retrievers/self_query</a>) for my RAG model, and it works fine. I can retrieve specific ch...
https://stackoverflow.com/questions/78091831/how-to-combine-parent-document-retriever-with-self-query-retriever-with-lang-cha
Question: <p>I'm trying to make a rag doll and I have 2 hip joints implemented as revolute joints. The problem is that they are not responding as independent segments. It seems like one of them is holding up the other one. It looks like this: <a href="https://i.sstatic.net/PQwd3.png" rel="nofollow noreferrer"><img src=...
https://stackoverflow.com/questions/42590376/box2d-javascript-revolute-joint-same-anchor-point-different-bodies
Question: <p>I want to add a simple chat UI to my RAG based chatbot. All the materials(one <a href="https://medium.com/@cleancoder/build-a-chatbot-in-minutes-with-chainlit-gpt-4-and-langchain-7690968578f0" rel="nofollow noreferrer">example</a>) I came across online have a very simple prompt template with <code>question...
https://stackoverflow.com/questions/78114723/how-to-pass-custom-prompt-variables-in-a-chainlit-app
Question: <p>I’m building a cricket-specific chatbot using CrewAI. The chatbot is designed to answer queries based on historical cricket data in CSV files and real-time data from APIs. The data is stored in an SQL database. However, I am experiencing slow response times for answering user queries, with response times r...
https://stackoverflow.com/questions/79335247/slow-response-time-in-cricket-specific-chatbot-using-crewai
Question: <p>This is a cross-post from <a href="https://github.com/stanfordnlp/dspy/issues/1245" rel="nofollow noreferrer">Issue #1245 of DSPy GitHub Repo</a>. There were no responses in the past week, am I am working on a project with a tight schedule.</p> <p>When running a DSPy module with a given signature, I am int...
https://stackoverflow.com/questions/78743278/dspy-how-to-get-the-number-of-tokens-available-for-the-input-fields
Question: <p>I've been using Azure AI Studio and Azure OpenAI Studio for a while now, and I'm currently working on implementing a RAG (Retrieval-Augmented Generation) technique using Prompt Flow. However, I've encountered an issue.</p> <p>Previously, in Azure AI Studio's Prompt Flow, there was an option to connect to A...
https://stackoverflow.com/questions/78905182/what-is-solution-of-missing-deployment-name-and-replaced-by-model-on-azure-ai-st
Question: <p>I have implemented streaming response in our rag(Retrieval-Augmented-Generation) chatbot. However, I am unable to figure out a proper way to send the metadata information with the streaming response.If, we do not use streaming, we can send the metadata with the message response in JSON format. But, in stre...
https://stackoverflow.com/questions/79323421/how-to-stream-openai-response-with-metadata
Question: <p><strong>Context:</strong></p> <p>I have a XML file (DEXPI) and I want to use it as a data source to implement Retrieval Augmented Generation (RAG) system using <code>llama-index</code> to fetch the correct context against any natural language query.</p> <p><strong>Current Issue:</strong></p> <ul> <li>I can...
https://stackoverflow.com/questions/77613200/creating-knowledge-graph-index-out-of-a-xml-dexpi-file
Question: <p>I implemented <a href="https://python.langchain.com/v0.1/docs/use_cases/question_answering/chat_history/" rel="nofollow noreferrer">this use case</a> from langchain to add chat history to my RAG to contextualize questions that may be incomplete. Everything works fine but now I would like to use only the la...
https://stackoverflow.com/questions/78518917/how-can-i-swap-an-instance-of-chatmessagehistory-with-an-instance-of-conversatio
Question: <p>I have a node express server setup for a llamaindex RAG system. Locally I'm able to generate a VectorIndexStore from a directory I've called <code>./data</code> and run queries successfully. However, I've just cloned the repo onto my AWS EC2 server and even though it boots up successfully it seems that the...
https://stackoverflow.com/questions/78894391/llamaindex-ts-simpledirectoryreader-works-locally-but-not-on-aws-ec2-server
Question: <p>I'm trying to understand what the correct strategy is for storing and using embeddings in a vector database, to be used with an LLM. If my goal is to reduce the amount of work the LLM has to do when generating a response, (So you can think of a RAG implementation where I've stored text, embeddings I've cr...
https://stackoverflow.com/questions/78023750/use-embeddings-stored-in-vector-db-to-reduce-work-for-llm-generating-response
Question: <p>Solutions like ChatGPT, Perplexity, and Copilot provide ways for users to reopen older conversations. I am trying to implement a similar feature using the Bot Framework and WebChat.</p> <p><strong>My setup</strong></p> <p>Last year I built a RAG-type chatbot for internal use at a company, using Bot Framewo...
https://stackoverflow.com/questions/79184231/how-to-continue-previous-conversations-with-transcript-data-in-bot-framework-and
Question: <p>I'm building a RAG based AI service using Langchain4j. I have one microservice that is ingesting and saving my documents (pdfs, csv, words...) in my PostgreSQL DB (with vector extension) as embeddings.</p> <p>From the other hand I'm building another microservice to hold the AI conversation logic.</p> <p>To...
https://stackoverflow.com/questions/77968544/langchain4j-pgvector-implementation-as-an-embeddingstore
Question: <p>I'm using Langchain agent to perform a RAG upon my own knowledge. The usual QnA flow works perfectly, but when it comes to chat_history the bot is not performing as expected. It does not re-create a user query with previous questions content when needed. Below is the base prompt that I'm usinng.</p> <p>&lt...
https://stackoverflow.com/questions/78808357/llama-3-chat-history-not-working-as-expected
Question: <p>So I've been trying to build an AADD(range, range) function. It's not complete so don't rag me about that. What's bothering me at the moment is that what the Script Editor says in meaningful code and what Google Sheets will run appears to be different.</p> <p>First of all here's the tester:</p> <pre><cod...
https://stackoverflow.com/questions/55381362/what-the-script-editor-accepts-and-what-google-sheets-accepts-can-be-different
Question: <p>I am a new user to Power Bi and I am hoping the community may be able to help me with my problem.</p> <p>In Power Bi I want to create a dashboard that will contain a gantt view of my projects refecltive of all the different stages/phases within the lifecycle in one line across the time horizon.</p> <p>My d...
https://stackoverflow.com/questions/77519040/gannt-chart-with-single-line-for-all-project-phases
Question: <p><code>I have been doing a POC to implement RAG driven model for my AI/ML use case.</code><br /> <code>The use case is to &quot;</code><strong><code>Find Similar and duplicate controls by comparing each ID with every other ID, Generate similarity scores and list the pairs which exceeds a threshold of 80-87 ...
https://stackoverflow.com/questions/78383658/qa-using-retrieval-augmented-generation-with-langchain
Question: <p>I am making a genetic algorithm and I have a sorting problem: I have such a class, it is represented as std::vector</p> <pre><code>class GA_Class { public: float Fitness = 0.0f; bool Parent = 0; }; typedef std::vector&lt;GA_Class&gt; GA_Vector; </code></pre> <p>Also I have a main class</p> <pre><code>cla...
https://stackoverflow.com/questions/76434205/how-can-i-sort-vector-of-vectors-by-other-vector
Question: <p>I've been working on developing and safeguarding a chat bot based on RAG - model and NeMo - Guardrails. I'm trying to integrate output rails alongside input rails. But I'm having trouble while doing so. The issue lies in YAML and COLANG contents because the input and output rails are not being initialized....
https://stackoverflow.com/questions/78904449/integrating-input-rails-and-output-rails-into-chat-bot-via-runnable-rails
Question: <p>I keep getting the above error when I try adding detection covariates on a beta-binomial N-mixture model in rags. According to Royle(2004). A binomial N mixture model can be used to model abundance data arising from repeat count surveys. The number of individuals on a site can be modeled by a Poisson <em>...
https://stackoverflow.com/questions/71720266/attempt-to-redefine-node-p1-1-when-adding-covariates-to-beta-binomial-mixture
Question: <p>The paper &quot;Natural Language Processing with Small Feed-Forward Networks&quot; <a href="https://arxiv.org/pdf/1708.00214.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1708.00214.pdf</a> states:</p> <p><a href="https://i.sstatic.net/gZXla.png" rel="nofollow noreferrer"><img src="https://i.sstatic...
https://stackoverflow.com/questions/62450062/dequantize-values-to-their-original-prior-to-quantization
Question: <p>I have a Raspberry Pi, and I'm livestreaming using FFmpeg. Unfortunately my wifi signal varies over the course of my stream. I'm currently using raspivid to send h264 encoded video to the stream. I have set a constant resolution and FPS, but have not set bitrate nor quantization, so they are variable.</p> ...
https://stackoverflow.com/questions/42492862/implementing-custom-h264-quantization-for-ffmpeg
Question: <p>I am having trouble implementing this code due to the variable <code>s_k</code> being logical 0/1. In what way can I implement this statement?</p> <p><img src="https://latex.codecogs.com/png.latex?x%28t%29%20%3D%20%5Csum_%7Bk%3Dt%7D%5E%7Bt&plus;N-1%7D%20s_k%202%5E%7B-%28k-n&plus;1%29%7D" alt=""></p> <p><...
https://stackoverflow.com/questions/28734781/matlab-help-in-implementing-quantized-time-series
Question: <p>I'm trying to implement <strong>quantization in neural network</strong> with tensorflow r1.0 and is not working i.e. Bazel BUILD files doesn't find targets and some other files.</p> <p>I realize that in the version <a href="https://github.com/tensorflow/tensorflow/tree/r0.9/tensorflow/contrib/quantizati...
https://stackoverflow.com/questions/43003778/quantized-neural-network-support-is-gone-in-tensorflow-1-0v
Question: <p>I have been trying to performing quantization on a densenet model without success. I have been trying to implement pytorch post training static quantization. Pytorch has quantized versions of other models, but does not have for densenet. Is it possible to quantize the densenet architecture.</p> <p>I have s...
https://stackoverflow.com/questions/74612146/is-it-possible-to-perform-quantization-on-densenet169-and-how
Question: <p>I am studying on the JPEG compression algorithm. I followed some simple version instruction to implement it in MatLab and I stuck at the quantization process.</p> <p>So in JPEG, I use 8x8 blocks as a unit to perform the forward transform then quantize each block based on a quantization matrix (or divide b...
https://stackoverflow.com/questions/44427748/how-to-do-quantization-in-jpeg-compression
Question: <p>In <code>image/draw</code>, <code>Quantizer</code> and <code>Drawer</code> are defined like this:</p> <pre class="lang-golang prettyprint-override"><code>type Quantizer interface { Quantize(p color.Palette, m image.Image) color.Palette } type Drawer interface { Draw(dst Image, r image.Rectangle, ...
https://stackoverflow.com/questions/70474890/having-trouble-when-implementing-the-interface-quantizer-and-drawer-of-gif
Question: <p><a href="https://i.sstatic.net/4R18J.png" rel="nofollow noreferrer">Tensorflow code for quantization</a> From all the papars i have reffered for CNN quantization the quantization scheme is stated as </p> <p>step size = range/255 for 8-bit here range = xmax-xmin but as shown in the image in the tensorflow...
https://stackoverflow.com/questions/60872726/quantization-scheme-for-convolutional-neural-network-8-bit-quantization-in-tenso
Question: <p>I am working with Tensorflow/Keras and want to quantize model parameters and then implement the model with Numpy. I've build 1D CNN model ,train it, then quantize its parameters , to UINT8 ,using Tensorflow post training quantization , then i've extract the weights and biases and export it to .npy file. Af...
https://stackoverflow.com/questions/64410930/different-results-between-quantized-tflite-model-to-its-implementation-using-num
Question: <p>We want to use C++ to develop a software for deep learning model training and quantification. For the convenience of deployment, we don't want to use python language, so we want to implement it based on libtorch. I found the following example program for python-based quantization-aware training in pytorch'...
https://stackoverflow.com/questions/75886648/can-libtorch-be-used-for-quantization-aware-training-of-models
Question: <p>I am studying about scalar vs vector quantization, and I have an assignment to implement (in MATLAB) a scalar quantizer , using the Lloyd-Max algorithm, and a vector quantizer via k-means clustering.</p> <p>The <strong>vector</strong> quantizer works in the R<sup>2</sup> vector space, so its input is a tup...
https://stackoverflow.com/questions/70596552/scalar-vs-vector-signal-quantization
Question: <p>I have a quantized model in pytorch and now I want to extract the parameter of the quantized linear layer and implement the forward manually. I search the source code but only find this function.</p> <pre><code>def forward(self, x: torch.Tensor) -&gt; torch.Tensor: return torch.ops.quantized.linear( ...
https://stackoverflow.com/questions/72101712/how-pytorch-implement-forward-for-a-quantized-linear-layer
Question: <p>I am new to tensorflow and quantization, am trying to implement quantized matmul operation for two int8 inputs. Was curious to know the math behind the operation. I see in tensorflow they have implemented the same only for uint8 inputs , would like to know how to use that for signed int8 matmul/conv2D.</p>...
https://stackoverflow.com/questions/53003155/how-to-find-float-output-range-for-quantized-matmul-conv2d-operation
Question: <p>I intend to display (4, 8 or 16 bit per channel - no alpha) images on a 1 bit display in an embedded system. Images are stored in RGB tuples. My intention is to use Floyd-Steinburg, as it looks reasonably good, is more than quick enough and concise in code.</p> <p>In reference to the WikiPedia <a href="...
https://stackoverflow.com/questions/3867581/image-dithering-how-would-i-calculate-quantization-error-and-nearest-colour-to
Question: <p>I’m trying to implement an MP3-like compression algorithm for audio and have followed the general steps, but I’m encountering a few issues with the quantization step. Here's the overall process I'm following:</p> <ol> <li>Apply Hanning window to the audio</li> <li>Apply a filter bank (mp3_forward_fbt).</li...
https://stackoverflow.com/questions/79333155/issues-with-mp3-like-compression-quantization-and-file-size
Question: <p>I'm interested in implementing a tool similar to <a href="https://www.canva.com/color-palette/" rel="nofollow noreferrer">Canva's Palette tool</a>, with the final goal of production CSS UI colors from an image (similar to how Spotify determines UI colors based on album art). </p> <p>I've read about <a hre...
https://stackoverflow.com/questions/53976162/color-quantization-same-as-detecting-color-palette
Question: <p>I was reading about quantization (specifically abount int8) and trying to figure it out if there is a method to avoid dequantize and requantize the output of a node before feeding it to the next one. So i eventually find the definition of static and dynamic quantization. According to <a href="https://onnxr...
https://stackoverflow.com/questions/78026212/does-static-quantization-enable-the-model-to-feed-a-layer-with-the-output-of-the
Question: <p>I'm following <a href="https://www.tensorflow.org/model_optimization/guide/quantization/training_comprehensive_guide?hl=en" rel="nofollow noreferrer">Quantization aware training comprehensive guide</a> and struggling with QAT for custom layers, working with <code>tf=2.6.0</code>, <code>py=3.9.7</code>. Bel...
https://stackoverflow.com/questions/70351174/fail-to-quantize-custom-layer-quantization-aware-training
Question: <p>Software for vector quantization usually works only on numerical data. One example of this is Python's <code>scipy.cluster.vq.vq</code> (<a href="http://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.cluster.vq.vq.html#scipy.cluster.vq.vq" rel="nofollow">here</a>), which performs vector quantiz...
https://stackoverflow.com/questions/27694998/vector-quantization-for-categorical-data
Question: <p>I would like to measure the quality of clustering using Quantization Error but can't find any clear info regarding how to compute this metric.</p> <p>The few documents/ articles I've found are:</p> <ul> <li>"<em><a href="https://www.sciencedirect.com/science/article/pii/S0031320314003781" rel="nofollow n...
https://stackoverflow.com/questions/48178527/how-to-compute-quantization-error-for-clustering
Question: <p>I want to reduce the color count of an image. Android provides a palette library to build palettes: <a href="https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder.html" rel="nofollow noreferrer">https://developer.android.com/reference/android/support/v7/graphics/Palette.Builde...
https://stackoverflow.com/questions/47287777/how-can-i-do-color-quantization-of-images-in-android
Question: <p>I am trying to Replace the encoder module of a application with my own Encoder which use WIC. and the old one seems set the Quantize factor to 90 (i don't know what happen in there, i just have dlls only). Now i have to set quantize factor too but i don't know how. is there any way to set that value like ...
https://stackoverflow.com/questions/29269431/set-quantize-factor-in-wic
Question: <p>I've implemented Minimum Variance Quantization algorithm described <a href="https://imcs.dvfu.ru/lib.int/docs/Programming/Graphics/Academic%20Press%20Graphics%20Gems%20Ii%201995.pdf" rel="nofollow noreferrer">here</a> on page 126 (or 154 if you use pdf viewer search). This method is used in matlab function...
https://stackoverflow.com/questions/39842367/minimum-variance-quantization-and-matlab
Question: <p>I am trying to convert the model with torch.nn.functional.grid_sample from Pytorch (1.9) to TensorRT (7) with INT8 quantization throught ONNX (opset 11). Opset 11 does not support grid_sample conversion to ONNX. Thus I used ONNX graphsurgeon together with the external GridSamplePlugin as it is <a href="htt...
https://stackoverflow.com/questions/69162186/how-to-convert-the-model-with-grid-sample-to-tensorrt-with-int8-quantization
Question: <p>I am trying to implement the <a href="http://www.jpathinformatics.org/article.asp?issn=2153-3539;year=2011;volume=2;issue=1;spage=13;epage=13;aulast=Hipp" rel="nofollow" title="original paper">algorithm</a> by Jason Hipp et al. There is also a <a href="http://www.pathinformatics.pitt.edu/sites/default/file...
https://stackoverflow.com/questions/13802434/spatially-invariant-vector-quantization
Question: <p>I am using Caffe to execute some Convolutional Neural Networks. However, my idea is executing the inference procedure by using quantized activations. Does anybody know the best way to do so? I've been looking up Ristretto, but I am not sure whether that framework quantizes the activations or only the weigh...
https://stackoverflow.com/questions/52700676/activations-quantization-for-convolutional-neural-network
Question: <p>I have a buffer with many positive 16bit values (which are stored as doubles) that I would like to quantize to 8bit (0-255 values).</p> <p>According to <a href="http://en.wikipedia.org/wiki/Quantization_%28signal_processing%29#Mathematical_description" rel="nofollow noreferrer">Wikipedia</a> the process w...
https://stackoverflow.com/questions/1966739/does-c-have-a-quantization-function
Question: <p>I am implementing an autoencoder, used to rebuild color images. The loss function I want to use requires a reduced color set (max ~100 different colors) but I am struggling to find a suitable differentiable algorithm.</p> <p>Another doubt I have is the following: is it better to apply such quantization dir...
https://stackoverflow.com/questions/74142324/is-there-a-differentiable-algorithm-for-image-quantization
Question: <p>I've been learning about quantization on TensorFlow 2.x using TFLiteConverter, however I'm implementing a project on TensorFlow 1.13 and I'd like to know how to do the same things on this version.</p> <p>For example, as far as I've observed the following commands do the same thing</p> <pre><code># tf 1.x...
https://stackoverflow.com/questions/60998416/tfliteconverter-parameters-for-optmization-on-tensorflow-1-x
Question: <p>I'm writing a web app that takes a user-submitted image, gets the pixel data via a <code>canvas</code> element, does some processing, and then renders the image using vector shapes (using <a href="http://vis.stanford.edu/protovis/" rel="nofollow noreferrer">Protovis</a>). It's working well, but I end up wi...
https://stackoverflow.com/questions/6205955/algorithm-for-color-quantization-reduced-image-color-palette-in-javascript
Question: <p>I am trying to implement Quantization Aware Training(QAT) resnet18 model. While inferring I get this error</p> <pre><code>NotImplementedError: Could not run 'aten::add.out' with arguments from the 'QuantizedCPU' backend </code></pre> <p>I am trying to follow <a href="https://pytorch.org/docs/stable/quantiz...
https://stackoverflow.com/questions/79240688/notimplementederror-could-not-run-atenadd-out-with-arguments-from-the-qua
Question: <p>I am working on school project that requires me to perform manual quantization of each layer of a model. Specifically, I want to implement manually:</p> <blockquote> <p>Quantized activation, combined with quantized weight A - layer A - quantized output - dequantized output - requantized output, combined wi...
https://stackoverflow.com/questions/78239906/how-to-manually-dequantize-the-output-of-a-layer-and-requantize-it-for-the-next
Question: <p>I am using Python 3.6 to perform basic image manipulation through Pillow. Currently, I am attempting to take 32-bit PNG images (RGBA) of arbitrary color compositions and sizes and quantize them to a known palette of 16 colors. Optimally, this quantization method should be able to leave fully transparent (A...
https://stackoverflow.com/questions/50801935/faster-implementation-to-quantize-an-image-with-an-existing-palette
Question: <p>I'm currently working on quantizing the Stable Diffusion v1.4 checkpoint without relying on external libraries such as torch.quantization or other quantization toolkits. I’m exploring two scenarios:</p> <p>Dynamic Quantization: I store weights in INT8 but dequantize them during inference. This approach wor...
https://stackoverflow.com/questions/79555026/stable-diffusion-v1-4-ptq-on-both-weight-and-activation
Question: <p>I am implementing a machine learning algorithm in matlab, and was doing some reading up on the color range of the human eye, and was informed that the human eye can only perceive about 17,000 colors, where as the images I have about 256^3 colours. What is the best way to quantization my images, in matlab o...
https://stackoverflow.com/questions/10372681/how-to-perform-color-quantization-in-matlab-or-otherwise
Question: <p><a href="https://github.com/antimatter15/jsgif/blob/master/NeuQuant.js" rel="nofollow noreferrer">NeuQuant.js</a> works well when the image width and height are a multiple of 100:</p> <p><img src="https://i.sstatic.net/uiWXI.gif" alt="300x300 animated gif"> 300x300</p> <p>Otherwise, there is obviously a ...
https://stackoverflow.com/questions/16371712/neuquant-js-javascript-color-quantization-hidden-bug-in-js-conversion
Question: <p><em>Context</em> :<br /> I would like to run inferencing of a DL-model on an Arduino and, since I don't have much memory available, I need to post-training <strong>int8-quantize</strong> my model.<br /> But the <strong>quantization</strong> of my model <strong>doesn't seem to be working</strong>, and it se...
https://stackoverflow.com/questions/67774808/is-elu-int8-quantisation-working-on-tensorflow-lite
Question: <p>I want to implement learned size quantization algorithm. And I create a quante Linear layer</p> <pre class="lang-py prettyprint-override"><code>class QLinear(nn.Module): def __init__(self, input_dim, out_dim, bits=8): super(QLinear, self).__init__() # create a tensor requires_grad=True ...
https://stackoverflow.com/questions/74387343/torch-parameter-grad-return-none
Question: <p>I am implementing a logarithmic quantizer and what I would like to do is to optimize the code as much as possible. The precise point where I would like to make a change is the last <code>else</code> statement where the equation to be implemented is:</p> <p><code>q(u) = u_i</code> if <code>u_i/(1+step) &lt;...
https://stackoverflow.com/questions/66075396/how-to-remove-infinite-while-loop-to-improve-matlab-code
Question: <p>I'm trying to implement a non-uniform quantizer with N-level of quantization. I have already done some work and it works, the problem is it goes into infinite loop when N(the number of levels) exceeds "4".</p> <p>If anyone can point out any hints to know where the wrong is, I'd appreciate it.</p> <pre><c...
https://stackoverflow.com/questions/41026017/what-is-the-condition-to-stop-splitting-data-in-non-uniform-quantizer
Question: <p>I am writing some python code that needs <a href="http://www.ijg.org/" rel="nofollow">libjpeg</a> . I searched for it on the Internet, and I couldn't find an implement of libjpeg in python. I would like to be able to access, DCT coefficient values, quantization tables, etc.</p> <p>Thanks!</p> Answer: <p>...
https://stackoverflow.com/questions/9695896/is-there-an-implementation-of-libjpeg-in-python
Question: <p>I'm working with Keras/Tensorflow to develop an ANN that will be deployed to a low-end MCU. For this purpose, I have quantized the original ANN using the post-training quantization mechanism offered by Tensorflow Lite. If the weights are indeed quantized to int8, biases were converted from float to int32. ...
https://stackoverflow.com/questions/63303255/is-it-possible-to-configure-tflite-to-return-a-model-with-bias-quantized-to-int8
Question: <p>I am trying to define a custom layer in Keras, where the data values are first quantized as -1, 0, or 1. Then, every -1 is transformed to 0. For example, The input tensor is x = [-0.95, -0.85,0.1,0.9]. It will be quantized to x1 = [-1,-1,0,1]. Then, x2 is transformed to x3 = [0,0,0,1]. I have completed the...
https://stackoverflow.com/questions/73369209/how-to-create-if-else-statement-in-a-custom-keras-layer
Question: <p>For research purposes, I'm trying to understand how TF Lite does its inference. I'm interested only in the software logic.</p> <p>I'm using TensorFlow 2.1 and TensorFlow Model Optimization 0.3.0.</p> <p>As an example, I use a very simple fully connected network:</p> <pre><code>tf.keras.models.Sequential...
https://stackoverflow.com/questions/61850203/how-to-implement-tf-lite-inference-in-python
Question: <p>I have two models that I have trained using Keras. The two models use the same architecture (the DenseNet169 implementation from <code>keras_applications.densenet</code> package), however they each have a different number of target classes (80 in one case, 200 in the other case).</p> <ul> <li><p>Convertin...
https://stackoverflow.com/questions/53050923/wildly-different-quantization-performance-on-tensorflow-lite-conversion-of-keras
Question: <p>Referring to that <a href="https://stackoverflow.com/questions/34422774/opengl-degenerate-gl-triangles-sharing-same-vertices/">question</a>:</p> <p>There are several ways to improve rendering speed for huge meshes. I tried the following implementations:</p> <ol> <li>Just render the mesh without any optim...
https://stackoverflow.com/questions/37069477/opengl-triangle-degeneration-after-vertex-shader
Question: <p>I am trying to implement UNet for Semantic Segmentation that can run on Google Coral edgetpu. In order to do so, we need to have a quantized model that can be obtained using the tensorflow_model_optimization API.</p> <p>But while using the API, there is a layer for UpSampling2D which is not supported by t...
https://stackoverflow.com/questions/61406595/layer-up-sampling2dclass-tensorflow-python-keras-layers-convolutional-upsampl
Question: <p>I have a set of image files, and I want to reduce the number of colors of them to 64. How can I do this with OpenCV?</p> <p>I need this so I can work with a 64-sized image histogram. I'm implementing CBIR techniques</p> <p>What I want is color quantization to a 4-bit palette.</p> Answer: <p>There are m...
https://stackoverflow.com/questions/5906693/how-to-reduce-the-number-of-colors-in-an-image-with-opencv
Question: <p>I'm implementing color quantization based on <em>k-means clustering</em> method on some RGB images. Then, I will determine the performance the algorithm. I found some information about training and testing. As I understand, I should divide the samples of images for training and testing. </p> <p>But I am ...
https://stackoverflow.com/questions/34577701/what-is-training-and-testing-in-image-processing
Question: <p>I'm trying to display a 16-bit tiff image in a html5 canvas, I found this library <a href="https://github.com/seikichi/tiff.js/" rel="nofollow">seikichi/tiff.js</a> and it works well but my images are dark, the pixel values are in the range [0- 300] then the image is quantized badly, the canvas displays a ...
https://stackoverflow.com/questions/35711632/display-dark-16-bit-tiff-in-canvas
Question: <p><strong>Problem:</strong></p> <p>I tried implementing Discrete Cosine Transformation compression using matlab. Input image would a jpg image (Lena) having a size 512 X 512.</p> <p>There are two stages namely compression and decompression. </p> <p><strong>Compression and Quantization:</strong></p> <p>Th...
https://stackoverflow.com/questions/53006940/2-dct-image-compression-matlab
Question: <p>I'm working on a deep learning project where I'm trying to implement a convolutional neural network (CNN) for Human Activity Recognition (HAR) using time-series data. The pipeline involves training a VGG-like teacher model, pruning it for efficiency, applying quantization-aware training, and then distillin...
https://stackoverflow.com/questions/79052285/error-while-training-pruned-and-quantized-cnn-model-using-tensorflow-model-optim
Question: <p>As per the title, I am having more trouble trying to convert to binary file. Below are my steps.</p> <p><strong>JPEG Compression Steps</strong></p> <ol> <li>Convert RGB into 3 channels</li> <li>For each channel (Y,Cb,Cr)</li> </ol> <ul> <li><p>(2.1) If channel is Cb or Cr</p> <ul> <li>Downsample</li> </ul>...
https://stackoverflow.com/questions/75939516/i-am-trying-to-implement-jpeg-compression-using-fft2-instead-of-dct2-in-matlab-a
Question: <p>I am training models using transformers, accelerate, bitsandbytes and PEFT. I recently got a second graphics card (RTX 3090) and am seeing a decent increase in training speed. However when experimenting with Lora and quantization, I found certain combinations weren't reducing memory as I'd expect.</p> <p>I...
https://stackoverflow.com/questions/78895910/unexpected-memory-usage-when-training-transformer-models-with-lora-and-quantizat