id stringlengths 7 11 | source stringclasses 1
value | category stringclasses 11
values | title stringlengths 15 214 | text stringlengths 70 30.5k | url stringlengths 57 160 | tags stringlengths 3 113 | created_at int64 1.22B 1.79B |
|---|---|---|---|---|---|---|---|
se_79523261 | stackoverflow | MACHINE_LEARNING | How to Identify Similar Code Parts Using CodeBERT Embeddings? | How to Identify Similar Code Parts Using CodeBERT Embeddings?
I'm using CodeBERT to compare how similar two pieces of code are. For example:
# Code 1
def calculate_area(radius):
return 3.14 * radius * radius
# Code 2
def compute_circle_area(r):
return 3.14159 * r * r
CodeBERT creates "embeddings," which are like det... | https://stackoverflow.com/questions/79523261/how-to-identify-similar-code-parts-using-codebert-embeddings | machine-learning, nlp, bert-language-model, plagiarism-detection, multihead-attention | 1,742,481,035 |
se_51476682 | stackoverflow | MACHINE_LEARNING | Training a model to identify names appearing in a sentence | Training a model to identify names appearing in a sentence
I have a dataset containing the names of about 238583 people. The names can contain more than one word for example:
Willie Enriquez , James J Johnson, D.J. Khaled.
My problem is to identify these names when it appears in a sentence. I am trying to create a m... | https://stackoverflow.com/questions/51476682/training-a-model-to-identify-names-appearing-in-a-sentence | machine-learning, nlp, named-entity-recognition | 1,532,341,830 |
se_9779179 | stackoverflow | MACHINE_LEARNING | Determine whether the two classes are linearly separable (algorithmically in 2D) | Determine whether the two classes are linearly separable (algorithmically in 2D)
There are two classes, let's call them X and O. A number of elements belonging to these classes are spread out in the xy-plane. Here is an example where the two classes are not linearly separable. It is not possible to draw a straight lin... | https://stackoverflow.com/questions/9779179/determine-whether-the-two-classes-are-linearly-separable-algorithmically-in-2d | algorithm, math, machine-learning, classification | 1,332,197,881 |
se_53256877 | stackoverflow | MACHINE_LEARNING | How to convert keras(h5) file to a tflite file? | How to convert keras(h5) file to a tflite file?
I got an keras(h5) file. I need to convert it to tflite??
I researched, First i need to go via h5 -> pb -> tflite
(because h5 - tflite sometimes results in some issue) | https://stackoverflow.com/questions/53256877/how-to-convert-kerash5-file-to-a-tflite-file | python, tensorflow, machine-learning, keras | 1,542,003,931 |
se_49322197 | stackoverflow | MACHINE_LEARNING | Comparing MSE loss and cross-entropy loss in terms of convergence | Comparing MSE loss and cross-entropy loss in terms of convergence
For a very simple classification problem where I have a target vector [0,0,0,....0] and a prediction vector [0,0.1,0.2,....1] would cross-entropy loss converge better/faster or would MSE loss?
When I plot them it seems to me that MSE loss has a lower er... | https://stackoverflow.com/questions/49322197/comparing-mse-loss-and-cross-entropy-loss-in-terms-of-convergence | machine-learning, logistic-regression, loss, cross-entropy, mean-square-error | 1,521,207,661 |
se_23053365 | stackoverflow | MACHINE_LEARNING | Classify Signal Images using Python | Classify Signal Images using Python
I have following Signal Images which I want to classify depending upon the shape. Which algorithm is suited to do this ? I have attached 2-2 images of each class. | https://stackoverflow.com/questions/23053365/classify-signal-images-using-python | python, image, machine-learning, classification | 1,397,457,028 |
se_51234035 | stackoverflow | MACHINE_LEARNING | Neural networks pytorch | Neural networks pytorch
I am implementing my own image classifier network. However I see for each epoch training accuracy is very good but validation accuracy is 0 till 5th epoch. I am using Adam optimizer and have learning rate .001. also resampling the whole data set after each epoch into training n validation set. ... | https://stackoverflow.com/questions/51234035/neural-networks-pytorch | python, machine-learning, conv-neural-network, pytorch | 1,531,067,731 |
se_66836846 | stackoverflow | MACHINE_LEARNING | Fastai predict on collaboative learning model | Fastai predict on collaboative learning model
I have a Fast ai collaborative filtering model. I would like to predict on this model for a new tuple.
I am having trouble with the predict function
From their documentation,
Signature: learn.predict(item, rm_type_tfms=None, with_input=False)
Docstring: Prediction on `item... | https://stackoverflow.com/questions/66836846/fastai-predict-on-collaboative-learning-model | machine-learning, pytorch, fast-ai | 1,616,885,360 |
se_53204674 | stackoverflow | MACHINE_LEARNING | relation between a categorical dependent variable and combination of independent variables | relation between a categorical dependent variable and combination of independent variables
I am looking for a technique which could help us find the relation in between a categorical dependent variable and combination of independent variables (Y ~ X1*X2+X2*X3+X3*X4), here among X1 to X4 we have few categorical columns... | https://stackoverflow.com/questions/53204674/relation-between-a-categorical-dependent-variable-and-combination-of-independent | machine-learning, statistics | 1,541,668,725 |
se_45504710 | stackoverflow | MACHINE_LEARNING | dropout with relu activations | dropout with relu activations
I am trying to implement a neural network with dropout in tensorflow.
tf.layers.dropout(inputs, rate, training)
From the documentation:
Dropout consists in randomly setting a fraction rate of input units to 0 at each update during training time, which helps prevent overfitting. The unit... | https://stackoverflow.com/questions/45504710/dropout-with-relu-activations | tensorflow, machine-learning, neural-network, activation-function, dropout | 1,501,843,285 |
se_51938859 | stackoverflow | MACHINE_LEARNING | Neural Network Regression | Neural Network Regression
For a given data set X with two classes {0,1}. If I train two separate neural networks NN0 and NN1 for each class 0 and 1 respectively. Can NN0 predict points in the dataset from class 1, even though it was trained on class 0? | https://stackoverflow.com/questions/51938859/neural-network-regression | machine-learning, neural-network, regression | 1,534,801,239 |
se_79455291 | stackoverflow | MACHINE_LEARNING | Tensorflow model training, List to numpy array conversion unevenly changes the shape of data | Tensorflow model training, List to numpy array conversion unevenly changes the shape of data
I am trying to predict LSDC from MRI images. For each study_id there are multiple images. Each study_id represents each patient. I want to predict 3 level of severity for 5 conditions on 5 levels.
I am trying to create dataset... | https://stackoverflow.com/questions/79455291/tensorflow-model-training-list-to-numpy-array-conversion-unevenly-changes-the-s | python, numpy, tensorflow, machine-learning, data-generation | 1,740,070,974 |
se_51545026 | stackoverflow | MACHINE_LEARNING | Implementing a custom dataset with PyTorch | Implementing a custom dataset with PyTorch
I'm attempting to modify this feedforward network taken from https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/01-basics/feedforward_neural_network/main.py
to utilize my own dataset.
I define a custom dataset of two 1 dim arrays as input and two scalars the cor... | https://stackoverflow.com/questions/51545026/implementing-a-custom-dataset-with-pytorch | python, machine-learning, neural-network, pytorch | 1,532,628,254 |
se_51181393 | stackoverflow | MACHINE_LEARNING | Simple Linear Regression using Keras | Simple Linear Regression using Keras
I have been trying to implement a simple linear regression model using neural networks in Keras in hopes to understand how do we work in Keras library. Unfortunately, I am ending up with a very bad model. Here is the implementation:
from pylab import *
from keras.models import Seq... | https://stackoverflow.com/questions/51181393/simple-linear-regression-using-keras | python, machine-learning, neural-network, keras, linear-regression | 1,530,743,251 |
se_60393573 | stackoverflow | MACHINE_LEARNING | Classification Neural Network does not learn | Classification Neural Network does not learn
I am building a classification Neural Network in order to classify two different classes.
So it is a binary classification problem, I am trying to solve this task by using a feedforward neural network.
But the network is not able to learn, in fact, the accuracy never change... | https://stackoverflow.com/questions/60393573/classification-neural-network-does-not-learn | python, tensorflow, machine-learning, keras, neural-network | 1,582,630,095 |
se_37876401 | stackoverflow | MACHINE_LEARNING | Recognize Names using Machine Learning | Recognize Names using Machine Learning
I'm working on a problem and I'm not sure if Machine Learning would be an ideal candidate here.
I have a list locations along their alias. This is a supervised set of data that i plan on using to train the model. Using this I want to identify them in a list extracted from a large... | https://stackoverflow.com/questions/37876401/recognize-names-using-machine-learning | machine-learning | 1,466,151,113 |
se_79525759 | stackoverflow | MACHINE_LEARNING | How to suppress warnings from model.load_state_dict() in PyTorch? | How to suppress warnings from model.load_state_dict() in PyTorch?
I'm loading a model checkpoint using
model.load_state_dict(state_dict, strict=False)
because the model architecture does not fully match the weights. As expected, this results in a warning message like this:
The model and loaded state dict do not match... | https://stackoverflow.com/questions/79525759/how-to-suppress-warnings-from-model-load-state-dict-in-pytorch | machine-learning, deep-learning, pytorch | 1,742,567,636 |
se_79524578 | stackoverflow | MACHINE_LEARNING | Google Colab: Model Training Stops Automatically as if Ctrl+C Was Pressed | Google Colab: Model Training Stops Automatically as if Ctrl+C Was Pressed
I'm training a YOLO model in Google Colab, but the training stops automatically as if I manually pressed Ctrl+C. The last output in the terminal shows ^C, and the process terminates without any error messages.
No error, just ^C appearing as if I... | https://stackoverflow.com/questions/79524578/google-colab-model-training-stops-automatically-as-if-ctrlc-was-pressed | machine-learning, google-colaboratory, yolo, ultralytics | 1,742,533,096 |
se_79477586 | stackoverflow | MACHINE_LEARNING | How to Convert 'data.ilearner' Model to 'model.pkl' in Azure ML? | How to Convert 'data.ilearner' Model to 'model.pkl' in Azure ML?
I created a pipeline in Azure ML that trains a model using Boosted Decision Tree Regression. From my understanding, the model is saved as data.ilearner.
However, I am unable to convert this model into a model.pkl format that can be loaded... | https://stackoverflow.com/questions/79477586/how-to-convert-data-ilearner-model-to-model-pkl-in-azure-ml | python, azure, machine-learning | 1,740,833,107 |
se_78126688 | stackoverflow | MACHINE_LEARNING | how can ı activate mps for yolov8 | how can ı activate mps for yolov8
from ultralytics import YOLO
model = YOLO("yolov8n.yaml") # build a new model from scratch
model = YOLO("yolov8n.pt")
model.to("mps")
results = model.train(data='data/datas.yaml',
conf=0.3,
epochs=3,device=‘mps’)
I am trying to train a model on my Yolov8 model, but even if I try for... | https://stackoverflow.com/questions/78126688/how-can-%c4%b1-activate-mps-for-yolov8 | machine-learning, pytorch, yolov8, metal-performance-shaders, macbookpro | 1,709,890,230 |
se_57099613 | stackoverflow | MACHINE_LEARNING | How is teacher-forcing implemented for the Transformer training? | How is teacher-forcing implemented for the Transformer training?
In this part of Tensorflow's tutorial, they mentioned that they are training with teacher-forcing. To my knowledge, teacher-forcing involves feeding the target output into the model so that it converges faster. So I'm curious as to how this is done here?... | https://stackoverflow.com/questions/57099613/how-is-teacher-forcing-implemented-for-the-transformer-training | tensorflow, machine-learning, nlp, transformer-model | 1,563,469,945 |
se_79523864 | stackoverflow | MACHINE_LEARNING | How to update model weights from a custom arbitrary loss function in Pytorch? | How to update model weights from a custom arbitrary loss function in Pytorch?
Starting with the end in mind:
Is there anyway I can write that arbitrary loss function by calling some pytorch functions, thus preserving the autograd graph?
How can I ensure my loss function is "wired" to autograd?
If that cannot be done ... | https://stackoverflow.com/questions/79523864/how-to-update-model-weights-from-a-custom-arbitrary-loss-function-in-pytorch | machine-learning, deep-learning, pytorch, loss-function | 1,742,496,823 |
se_79521051 | stackoverflow | MACHINE_LEARNING | Get Object Detection results from Edge export TFJS model, bin & dict in Express/Node API | Get Object Detection results from Edge export TFJS model, bin & dict in Express/Node API
I have exported my VertexAI model to TFJS as "edge", which results in:
dict.txt
group1_shard1of2.bin
group1_shard2of2.bin
model.json
Now, I send an image from my client to the Node/Express endpoint which I am really having a... | https://stackoverflow.com/questions/79521051/get-object-detection-results-from-edge-export-tfjs-model-bin-dict-in-express | javascript, machine-learning, object-detection, tensorflow.js, google-cloud-vertex-ai | 1,742,407,880 |
se_69977249 | stackoverflow | MACHINE_LEARNING | How to make Tesseract recognize hyphens or minus signs? | How to make Tesseract recognize hyphens or minus signs?
I want to use tesseract to read the grades on a graduation diploma. These are in a table-like structure as you can see here: https://www.asv.bayern.de/doku/gy/oberstufe/zeugnis/abitur
Since tesseract is not actually designed to read tables, I break the table into... | https://stackoverflow.com/questions/69977249/how-to-make-tesseract-recognize-hyphens-or-minus-signs | r, machine-learning, ocr, tesseract | 1,636,991,776 |
se_36846795 | stackoverflow | MACHINE_LEARNING | Support Vector Machine. Precision and/or accuracy? | Support Vector Machine. Precision and/or accuracy?
I am trying to figure whether the code I use calculates precision or accuracy or both. Since I only have a little background in statistics (in another language) I don't really understand the Wikipedia article covering that topic.
Concretely I use following Python code... | https://stackoverflow.com/questions/36846795/support-vector-machine-precision-and-or-accuracy | python, machine-learning, scikit-learn, svm | 1,461,603,817 |
se_79494100 | stackoverflow | MACHINE_LEARNING | Why does my Llama 3.1 model act differently between AutoModelForCausalLM and LlamaForCausalLM? | Why does my Llama 3.1 model act differently between AutoModelForCausalLM and LlamaForCausalLM?
I have one set of weights, one tokenizer, the same prompt, and identical generation parameters. Yet somehow, when I load the model using AutoModelForCausalLM, I get one output, and when I construct it manually with LlamaForC... | https://stackoverflow.com/questions/79494100/why-does-my-llama-3-1-model-act-differently-between-automodelforcausallm-and-lla | python, machine-learning, pytorch, huggingface, llama | 1,741,422,252 |
se_79521352 | stackoverflow | MACHINE_LEARNING | Why won't tf.keras let me pass a dictionary of multiple sample weights? | Why won't tf.keras let me pass a dictionary of multiple sample weights?
I am trying to pass individual np.arrays of sample_weights for two outputs of my Keras model, one of which is a confidence measure of a binary value and one of which is a continuous output. However, I receive a KeyError: 0 as tf.keras tries to... | https://stackoverflow.com/questions/79521352/why-wont-tf-keras-let-me-pass-a-dictionary-of-multiple-sample-weights | python, machine-learning, keras, tensorflow2.0, tf.keras | 1,742,417,221 |
se_79521737 | stackoverflow | MACHINE_LEARNING | Is there a way to show the training log output from the ML.NET Fit() function in the training pipeline? | Is there a way to show the training log output from the ML.NET Fit() function in the training pipeline?
I'm using version 3.0.1 of the Microsoft.ML library in my C# WinForms object detection program.
When I add a Machine Learning Model to my Visual Studio project, training it on the MLModel1.mbconfig page shows a usef... | https://stackoverflow.com/questions/79521737/is-there-a-way-to-show-the-training-log-output-from-the-ml-net-fit-function-in | c#, winforms, machine-learning, ml.net | 1,742,436,431 |
se_76817578 | stackoverflow | MACHINE_LEARNING | feedback loop: Expected a 'cpu' device type for generator but found 'mps' | feedback loop: Expected a 'cpu' device type for generator but found 'mps'
I am trying to finetune a HuggingFace model on MacOS M2. However, the torch operator 'aten::random_' does not exist yet for MPS. Therefore, I ran the program with
PYTORCH_ENABLE_MPS_FALLBACK=1
Then I got the following message "... | https://stackoverflow.com/questions/76817578/feedback-loop-expected-a-cpu-device-type-for-generator-but-found-mps | macos, machine-learning, pytorch, huggingface-transformers, metal-performance-shaders | 1,690,961,671 |
se_76939164 | stackoverflow | MACHINE_LEARNING | Running model prompt on stable diffusion model from hugging face on mps MacOS | Running model prompt on stable diffusion model from hugging face on mps MacOS
import gradio as gr
import torch
import numpy as np
import modin.pandas as pd
from PIL import Image
from diffusers import DiffusionPipeline
import os
os.environ["PYTORCH_MPS_HIGH_WATERMARK_RATIO"] = "0.0"
device = 'cuda' if torch.cuda.is_a... | https://stackoverflow.com/questions/76939164/running-model-prompt-on-stable-diffusion-model-from-hugging-face-on-mps-macos | python, machine-learning, pytorch, huggingface, metal-performance-shaders | 1,692,530,864 |
se_76196734 | stackoverflow | MACHINE_LEARNING | Pytorch MPS: 'mps.scatter_nd' op invalid input tensor shape | Pytorch MPS: 'mps.scatter_nd' op invalid input tensor shape
I have set up my model for hyper parameter tuning using either nevergrad or optuna (both result in the same problem).
The problem:
After the first model has trained (i.e. first parameter search), then when the second is about to begin training, I get ... | https://stackoverflow.com/questions/76196734/pytorch-mps-mps-scatter-nd-op-invalid-input-tensor-shape | python, machine-learning, pytorch, metal, metal-performance-shaders | 1,683,503,093 |
se_76991341 | stackoverflow | MACHINE_LEARNING | DataLoader - pytorch inconsistency between cpu and mps - Apple Silicon | DataLoader - pytorch inconsistency between cpu and mps - Apple Silicon
I got stuck on this inconsistency with DataLoader in Pytorch on Mac Apple Silicone.
If I use cpu y is interpreted correctly. However If I use mps it always returns vector with correct length, however only based on first element y[0].
import torch
f... | https://stackoverflow.com/questions/76991341/dataloader-pytorch-inconsistency-between-cpu-and-mps-apple-silicon | python, machine-learning, pytorch, metal-performance-shaders, apple-m2 | 1,693,212,944 |
se_76954976 | stackoverflow | MACHINE_LEARNING | Torch MPS on Intel Mac: get name of device? | Torch MPS on Intel Mac: get name of device?
In Python, on a machine that has an NVIDIA GPU, one can confirm the mps device name of the GPU using:
torch.cuda.get_device_name()
Per the docs: https://pytorch.org/docs/stable/generated/torch.cuda.get_device_name.html#torch.cuda.get_device_name
How do I confirm the mps devi... | https://stackoverflow.com/questions/76954976/torch-mps-on-intel-mac-get-name-of-device | python, macos, machine-learning, pytorch, metal-performance-shaders | 1,692,719,305 |
se_75173055 | stackoverflow | MACHINE_LEARNING | How to resolve "MPS Framework doesn't support float64" on M1 Mac | How to resolve "MPS Framework doesn't support float64" on M1 Mac
I am trying to train a YOLO model on a custom dataset using YOLOv8 Ultralytics, using M1 MacBook Pro MPS acceleration which is supported by PyTorch but I am getting the following error while executing the train command.
Command:
!yolo task=... | https://stackoverflow.com/questions/75173055/how-to-resolve-mps-framework-doesnt-support-float64-on-m1-mac | python, machine-learning, pytorch, yolo, metal-performance-shaders | 1,674,135,282 |
se_79274150 | stackoverflow | MACHINE_LEARNING | Getting RuntimeError: view size is not compatible with input tensor's size and stride while using mps | Getting RuntimeError: view size is not compatible with input tensor's size and stride while using mps
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.
Getting this error only while using mps and ... | https://stackoverflow.com/questions/79274150/getting-runtimeerror-view-size-is-not-compatible-with-input-tensors-size-and-s | python, machine-learning, pytorch, metal-performance-shaders | 1,733,988,047 |
se_78643538 | stackoverflow | MACHINE_LEARNING | Upgrading to Stable Diffusion 3 from 2-1 on mac | Upgrading to Stable Diffusion 3 from 2-1 on mac
I'm upgrading my stable diffusion from 2-1 to stable-diffusion-3-medium-diffusers
Here is my code which is working for version 2-1
# source venv/bin/activate
from diffusers import DiffusionPipeline
pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-... | https://stackoverflow.com/questions/78643538/upgrading-to-stable-diffusion-3-from-2-1-on-mac | python, macos, machine-learning, stable-diffusion, metal-performance-shaders | 1,718,812,706 |
se_78523154 | stackoverflow | MACHINE_LEARNING | MPS device and Pytorch | MPS device and Pytorch
I want to rum mpnn with a lightning trainer on my mac.
These are my trainer settings:
trainer = pl.Trainer(
logger=False,
enable_checkpointing=True, #
enable_progress_bar=True,
accelerator="mps",
devices= 1,
max_epochs=20, # number of epochs to train for
)
I also changed... | https://stackoverflow.com/questions/78523154/mps-device-and-pytorch | machine-learning, pytorch, lightning, metal-performance-shaders | 1,716,467,648 |
se_34550577 | stackoverflow | MACHINE_LEARNING | Sci-Kit Learn: Investigating Incorrectly Classified Data | Sci-Kit Learn: Investigating Incorrectly Classified Data
I want to analyze data that has been incorrectly classified by a model using sci-kit learn, so that I can improve my feature generation. I have a method for doing this, but I am both new to sci-kit learn and pandas, so I'd like to know if there is a more efficie... | https://stackoverflow.com/questions/34550577/sci-kit-learn-investigating-incorrectly-classified-data | python, machine-learning, scikit-learn | 1,451,588,098 |
se_56177767 | stackoverflow | MACHINE_LEARNING | How to scale back predicted data with skLearn MinMaxScaler()? | How to scale back predicted data with skLearn MinMaxScaler()?
I am creating a neural network to denoise music.
The input to the model is an array that is scaled from 0 to 1. This is achieved using sklearn MinMaxScaler. The original range of the data is from -1 to 1. The output of the model is also an array scaled fr... | https://stackoverflow.com/questions/56177767/how-to-scale-back-predicted-data-with-sklearn-minmaxscaler | python, machine-learning, scikit-learn | 1,558,049,186 |
se_20772601 | stackoverflow | MACHINE_LEARNING | Cross validation with precision scoring for a subset of classes | Cross validation with precision scoring for a subset of classes
I have a dataset for classification with 3 class labels [0,1,2].
I want to run cross validation and try several estimators, but I am interested in scoring with precision of only classes 1 and 2. I don't care about the precision of class 0, and I don't wa... | https://stackoverflow.com/questions/20772601/cross-validation-with-precision-scoring-for-a-subset-of-classes | python, machine-learning, cross-validation, scikit-learn | 1,387,973,034 |
se_42843352 | stackoverflow | MACHINE_LEARNING | Is there a way to save the preprocessing objects in scikit-learn? | Is there a way to save the preprocessing objects in scikit-learn?
I am building a neural net with the purpose of make predictions on new data in the future. I first preprocess the training data using sklearn.preprocessing, then train the model, then make some predictions, then close the program. In the future, when ne... | https://stackoverflow.com/questions/42843352/is-there-a-way-to-save-the-preprocessing-objects-in-scikit-learn | machine-learning, scikit-learn, preprocessor | 1,489,692,996 |
se_73053195 | stackoverflow | MACHINE_LEARNING | Saving a scaler in a model | Saving a scaler in a model
I'm using the following scaler:
scaler = preprocessing.MinMaxScaler()
X_train = pd.DataFrame(scaler.fit_transform(dataset_train),
columns=dataset_train.columns,
index=dataset_train.index)
X_train.sample(frac=1)
X_test = pd.Data... | https://stackoverflow.com/questions/73053195/saving-a-scaler-in-a-model | python, machine-learning, scikit-learn | 1,658,326,144 |
se_45068568 | stackoverflow | MACHINE_LEARNING | How to create a new gym environment in OpenAI? | How to create a new gym environment in OpenAI?
I have an assignment to make an AI Agent that will learn to play a video game using ML. I want to create a new environment using OpenAI Gym because I don't want to use an existing environment. How can I create a new, custom Environment?
Also, is there any other way I can ... | https://stackoverflow.com/questions/45068568/how-to-create-a-new-gym-environment-in-openai | machine-learning, artificial-intelligence, openai-gym | 1,499,898,741 |
se_51688568 | stackoverflow | MACHINE_LEARNING | Faster kNN Classification Algorithm in Python | Faster kNN Classification Algorithm in Python
I want to code my own kNN algorithm from scratch, the reason is that I need to weight the features. The problem is that my program is still really slow despite removing for loops and using built in numpy functionality.
Can anyone suggest a way to speed this up? I don't us... | https://stackoverflow.com/questions/51688568/faster-knn-classification-algorithm-in-python | python, machine-learning, scikit-learn, knn | 1,533,407,964 |
se_79494728 | stackoverflow | MACHINE_LEARNING | Deconstructiong the Stable Diffusion 3.5 pipeline | Deconstructiong the Stable Diffusion 3.5 pipeline
I am trying to deconstruct the SD3.5 (specifically 3.5 medium) pipeline in order to have a controlled process over the denoising steps. I can't do callbacks because I need to modify the latent according to other pipelines.
I am trying to perform the steps on the follow... | https://stackoverflow.com/questions/79494728/deconstructiong-the-stable-diffusion-3-5-pipeline | machine-learning, huggingface, stable-diffusion | 1,741,453,578 |
se_79395423 | stackoverflow | MACHINE_LEARNING | NumPy Stride Tricks: Is it possible to add the windows back into the original array size at the same location without for loops? | NumPy Stride Tricks: Is it possible to add the windows back into the original array size at the same location without for loops?
I'm currently trying to implement my own version of 2D Pooling (with channels included) in Python using only NumPy, but I've run into a bit of a roadblock with vectorizing the backpropagatio... | https://stackoverflow.com/questions/79395423/numpy-stride-tricks-is-it-possible-to-add-the-windows-back-into-the-original-ar | python, numpy, machine-learning, numpy-ndarray | 1,738,106,930 |
se_45799926 | stackoverflow | MACHINE_LEARNING | Why batch normalization over channels only in CNN | Why batch normalization over channels only in CNN
I am wondering, if in Convolutional Neural Networks batch normalization should be applied with respect to every pixel separately, or should I take the mean of pixels with respect to each channel?
I saw that in the description of Tensorflow's tf.layers.batch_normalizat... | https://stackoverflow.com/questions/45799926/why-batch-normalization-over-channels-only-in-cnn | machine-learning, computer-vision, convolution, batch-normalization | 1,503,326,457 |
se_78161067 | stackoverflow | MACHINE_LEARNING | Issue Accessing .bin Files in React Native App | Issue Accessing .bin Files in React Native App
I'm encountering an issue with accessing .bin files in my React Native app. I followed the process of saving my TensorFlow model in .h5 format, converting it to JSON and binary files, and then moving these files to the application directory. However, while I can access th... | https://stackoverflow.com/questions/78161067/issue-accessing-bin-files-in-react-native-app | react-native, machine-learning, tensorflow2.0, tensorflow-datasets, sentiment-analysis | 1,710,424,751 |
se_55880598 | stackoverflow | MACHINE_LEARNING | Predict probability of predicted class | Predict probability of predicted class
I have a dataset containing the GPA, GRE, TOEFL, SOP&LOR Ranking(out of 5)etc. (all numerical) , and a final column that states whether or not they were admitted to a university(0 or 1), which is what we'll use as y_train.
I'm supposed to not just classify the predicted labels, b... | https://stackoverflow.com/questions/55880598/predict-probability-of-predicted-class | machine-learning, scikit-learn | 1,556,368,417 |
se_79490841 | stackoverflow | MACHINE_LEARNING | Snowflake ML Registry for Model Explainability: `ValueError: Model type <class 'NoneType'> is not supported` when logging a Pipeline | Snowflake ML Registry for Model Explainability: `ValueError: Model type <class 'NoneType'> is not supported` when logging a Pipeline
I am training an XGBClassifier model using Snowflake ML and attempting to register it using Snowflake’s model registry. The training and evaluation steps complete successfu... | https://stackoverflow.com/questions/79490841/snowflake-ml-registry-for-model-explainability-valueerror-model-type-class | python, machine-learning, snowflake-cloud-data-platform | 1,741,300,110 |
se_79512816 | stackoverflow | MACHINE_LEARNING | How to scale learning rates per parameter with Penzai and Optax | How to scale learning rates per parameter with Penzai and Optax
I want to train a simple feed forward neural net that I've built in penzai, but I want to use different learning rates for each parameter group. I store the learning rate scale factor in each parameter's metadata, e.g. like this:
Parameter(
label='mlp... | https://stackoverflow.com/questions/79512816/how-to-scale-learning-rates-per-parameter-with-penzai-and-optax | python, machine-learning, jax | 1,742,140,553 |
se_79495542 | stackoverflow | MACHINE_LEARNING | ResNet50 on TPU calculates NaN for accuracy and loss, works fine on CPU in Google Colab | ResNet50 on TPU calculates NaN for accuracy and loss, works fine on CPU in Google Colab
I've trained a ResNet50 on v2-8 TPU accelerator using google colab, I've fed it with 5000 images of shape (224, 224, 3). I've normalized them, no nans, no inf, no class imbalance and everything is alright:
INPUT_SHAPE = (224, 224, ... | https://stackoverflow.com/questions/79495542/resnet50-on-tpu-calculates-nan-for-accuracy-and-loss-works-fine-on-cpu-in-googl | tensorflow, machine-learning, keras, google-colaboratory, tpu | 1,741,504,030 |
se_34698161 | stackoverflow | MACHINE_LEARNING | How to interpret almost perfect accuracy and AUC-ROC but zero f1-score, precision and recall | How to interpret almost perfect accuracy and AUC-ROC but zero f1-score, precision and recall
I am training ML logistic classifier to classify two classes using python scikit-learn. They are in an extremely imbalanced data (about 14300:1). I'm getting almost 100% accuracy and ROC-AUC, but 0% in precision, recall, and f... | https://stackoverflow.com/questions/34698161/how-to-interpret-almost-perfect-accuracy-and-auc-roc-but-zero-f1-score-precisio | machine-learning, classification, roc, precision-recall | 1,452,369,050 |
se_66472157 | stackoverflow | MACHINE_LEARNING | Federated averaging implementation in python | Federated averaging implementation in python
I am working with federated learning. I am using a global server where I defined a cnn based classifier. The global server compiles the model with hyper-parameters and send it to the edge(clients), currently I am using two clients. Each client uses its local data (for now I... | https://stackoverflow.com/questions/66472157/federated-averaging-implementation-in-python | python, machine-learning, conv-neural-network, tensorflow-federated, federated-learning | 1,614,850,057 |
se_63380766 | stackoverflow | MACHINE_LEARNING | How to unscale data after predictions? | How to unscale data after predictions?
I have a dataset with 2 features (price & volume) & 1 predicted variable (price) and use LTSM model to predict next price based on the previous set of prices.
First I scale the dataset:
#Scale the data
scaler = MinMaxScaler(feature_range=(0,1))
scaled_data = scaler.fit_transform(... | https://stackoverflow.com/questions/63380766/how-to-unscale-data-after-predictions | python, machine-learning, scikit-learn | 1,597,249,250 |
se_51006505 | stackoverflow | MACHINE_LEARNING | How training and test data is split? | How training and test data is split?
I am currently training my data using neural network and using fit function.
history = model.fit(X, encoded_Y, batch_size=50, nb_epoch=500, validation_split=0.2, verbose=1)
Now I have used validation_split as 20%. What I understood is that my training data will be 80% and testing ... | https://stackoverflow.com/questions/51006505/how-training-and-test-data-is-split | tensorflow, machine-learning, keras, neural-network | 1,529,807,287 |
se_72552272 | stackoverflow | MACHINE_LEARNING | Strange behaviour when passing a function into a Tensorflow dataset map method | Strange behaviour when passing a function into a Tensorflow dataset map method
This was working perfectly fine for me earlier today, but it suddenly started behaving very strangely when I restarted my notebook.
I have a tf dataset that takes in numpy files and their corresponding labels as input, like so tf.data.Datas... | https://stackoverflow.com/questions/72552272/strange-behaviour-when-passing-a-function-into-a-tensorflow-dataset-map-method | python, tensorflow, machine-learning, deep-learning, tensorflow-datasets | 1,654,722,817 |
se_79504547 | stackoverflow | MACHINE_LEARNING | LogVar layer of a VAE only returns zeros | LogVar layer of a VAE only returns zeros
I'm building a Variational auto encoder (VAE) with tfjs.
For now I'm only exploring with the fashionMNIST dataset and a simple model as follows:
input layer (28*28*1)
flatten
intermediate_1 (dense 50 units - relu)
mean (dense 10 units - relu) // logVar (dense 10 units relu)
Sam... | https://stackoverflow.com/questions/79504547/logvar-layer-of-a-vae-only-returns-zeros | machine-learning, deep-learning, loss-function, tensorflow.js, autoencoder | 1,741,803,602 |
se_79500227 | stackoverflow | MACHINE_LEARNING | Why am I getting RuntimeError: no running event loop and in my VS code when I am trying to run my command streamlit run main.py? | Why am I getting RuntimeError: no running event loop and in my VS code when I am trying to run my command streamlit run main.py?
I am trying to build a conversational chatbot using VS Code. The code is following:
## RAG Q&A Conversation With PDF Including Chat History
import streamlit as st
from langchain.chains impor... | https://stackoverflow.com/questions/79500227/why-am-i-getting-runtimeerror-no-running-event-loop-and-in-my-vs-code-when-i-am | machine-learning, deep-learning, artificial-intelligence, chatbot, langchain | 1,741,685,646 |
se_79502752 | stackoverflow | MACHINE_LEARNING | Getting Cuda out of memory when importing microsoft/Orca-2-13b from hugging faces | Getting Cuda out of memory when importing microsoft/Orca-2-13b from hugging faces
I am using Ubuntu 24.04.1 on an AWS EC2 instance g5.8xlarge.
I am receiving the following error message:
OutOfMemoryError: Allocation on device
Code:
import os
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "backend:cudaMallocAsync"
import to... | https://stackoverflow.com/questions/79502752/getting-cuda-out-of-memory-when-importing-microsoft-orca-2-13b-from-hugging-face | machine-learning, pytorch, huggingface-transformers, huggingface | 1,741,759,557 |
se_45627784 | stackoverflow | MACHINE_LEARNING | Unable to obtain accuracy score for my linear regression | Unable to obtain accuracy score for my linear regression
I am working on my regression model based on the IMDB data, to predict IMDB value. On my linear-regression, i was unable to obtain the accuracy score.
my line of code:
metrics.accuracy_score(test_y, linear_predicted_rating)
Error:
ValueError: continuous is not ... | https://stackoverflow.com/questions/45627784/unable-to-obtain-accuracy-score-for-my-linear-regression | python, machine-learning, scikit-learn | 1,502,430,390 |
se_79500324 | stackoverflow | MACHINE_LEARNING | How can I pass environment variables to a custom training script in Amazon SageMaker using the Python SDK? | How can I pass environment variables to a custom training script in Amazon SageMaker using the Python SDK?
I'm training a custom model using a script in Amazon SageMaker and launching the job with the Python SDK. I want to pass some environment variables (like API keys or config flags) to the training job so they’re a... | https://stackoverflow.com/questions/79500324/how-can-i-pass-environment-variables-to-a-custom-training-script-in-amazon-sagem | python, amazon-web-services, machine-learning, amazon-sagemaker | 1,741,687,230 |
se_41143056 | stackoverflow | MACHINE_LEARNING | How to change the value of variables each iteration after the graph is built? | How to change the value of variables each iteration after the graph is built?
I want to change the value of the variables manually in each iteration in Tensorflow, but i don't want to change the gradient computation. How to do it? | https://stackoverflow.com/questions/41143056/how-to-change-the-value-of-variables-each-iteration-after-the-graph-is-built | tensorflow, machine-learning | 1,481,719,642 |
se_78241816 | stackoverflow | MACHINE_LEARNING | Pycharm debug is not working with Tensorflow. How do I resolve it? | Pycharm debug is not working with Tensorflow. How do I resolve it?
I have successfully installed the following:
tensorflow (latest version 2.16.1)
keras (latest version 3.1.1
I am using pycharm 2023.3.5 (community Edition). I have some lines of codes with imports including tensorflow:
...
from tensorflow.keras impor... | https://stackoverflow.com/questions/78241816/pycharm-debug-is-not-working-with-tensorflow-how-do-i-resolve-it | python-3.x, tensorflow, machine-learning | 1,711,682,246 |
se_79498420 | stackoverflow | MACHINE_LEARNING | Computing Gradient of Loss w.r.t Learning Rate PyTorch | Computing Gradient of Loss w.r.t Learning Rate PyTorch
I am building a custom optimizer that samples learning rates from a Dirichlet distribution, whose parameters (alpha) need to be updated in each backpropagation. I've already figured out how to get the loss w.r.t. to these alpha parameters, effectively this would b... | https://stackoverflow.com/questions/79498420/computing-gradient-of-loss-w-r-t-learning-rate-pytorch | machine-learning, optimization, deep-learning, pytorch, backpropagation | 1,741,619,462 |
se_79469004 | stackoverflow | MACHINE_LEARNING | Do Evaluate process in Palantir Foundry Model Training parameters (mean, sd) from "Train data" to "Test data"? | Do Evaluate process in Palantir Foundry Model Training parameters (mean, sd) from "Train data" to "Test data"?
If I understand the process correctly, when scaling test data in machine learning, you should use the scaling parameters (like mean and standard deviation) learned from the training data t... | https://stackoverflow.com/questions/79469004/do-evaluate-process-in-palantir-foundry-model-training-parameters-mean-sd-fro | machine-learning, regression, logistic-regression, palantir-foundry | 1,740,558,722 |
se_79474361 | stackoverflow | MACHINE_LEARNING | Why VotingClassifer performance with voting set to "hard" is different with different weights? | Why VotingClassifer performance with voting set to "hard" is different with different weights?
I wanted to test VotingClassifier from sklearn and comparae performance with different parameters. I used param grid and then I notice something unintelligible.
I prepared three classifiers
gnb = GaussianNB() # Acc... | https://stackoverflow.com/questions/79474361/why-votingclassifer-performance-with-voting-set-to-hard-is-different-with-diff | machine-learning, scikit-learn, classification, voting | 1,740,708,868 |
se_79439790 | stackoverflow | MACHINE_LEARNING | Non deterministic behavior of a CNN network after adding self attention | Non deterministic behavior of a CNN network after adding self attention
When I added NLBloclos, a self-attention layer to my network (simple CNN) the result of the network was not reproducible anymore, when I trained it again, the result was different. But when I remove the NLBlocks in the network it is deterministic.... | https://stackoverflow.com/questions/79439790/non-deterministic-behavior-of-a-cnn-network-after-adding-self-attention | tensorflow, machine-learning, keras, conv-neural-network, self-attention | 1,739,545,725 |
se_78862426 | stackoverflow | MACHINE_LEARNING | Unable to use nltk functions | Unable to use nltk functions
I was trying to run some nltk functions on the UCI spam message dataset but ran into this problem of word_tokenize not working even after downloading dependencies.
import nltk
nltk.download('punkt')
from nltk.tokenize import word_tokenize
df['text'].apply(lambda x: len(nltk.word_tokenize(... | https://stackoverflow.com/questions/78862426/unable-to-use-nltk-functions | python, machine-learning, nlp, nltk | 1,723,475,849 |
se_28314337 | stackoverflow | MACHINE_LEARNING | TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0] while using RF classifier? | TypeError: sparse matrix length is ambiguous; use getnnz() or shape[0] while using RF classifier?
I am learning about random forests in scikit learn and as an example I would like to use Random forest classifier for text classification, with my own dataset. So first I vectorized the text with tfidf and for classificat... | https://stackoverflow.com/questions/28314337/typeerror-sparse-matrix-length-is-ambiguous-use-getnnz-or-shape0-while-usi | python, numpy, machine-learning, nlp, scikit-learn | 1,423,028,915 |
se_53278489 | stackoverflow | MACHINE_LEARNING | Perfect precision, recall and f1-score, yet bad prediction | Perfect precision, recall and f1-score, yet bad prediction
Using scikit-learn to classify a binary problem. Getting perfect classification_report (all 1's). Yet prediction gives 0.36. How can it be?
I'm familiar with imbalanced labels. Yet I don't think this is the case here since f1 and the other score columns, as w... | https://stackoverflow.com/questions/53278489/perfect-precision-recall-and-f1-score-yet-bad-prediction | python, machine-learning, scikit-learn, prediction, decision-tree | 1,542,103,557 |
se_58429786 | stackoverflow | MACHINE_LEARNING | How to show error output between boosting rounds in XGBoost? | How to show error output between boosting rounds in XGBoost?
I'm using Scikit-Learn API, XGBRegressor. I'm trying to make my model as verbose as possible. These are the parameters of the model. This is running on Kaggle kernels. df_train and df_target are pandas dataframes.
model = xgb.XGBRegressor(
n_estimators=... | https://stackoverflow.com/questions/58429786/how-to-show-error-output-between-boosting-rounds-in-xgboost | python, machine-learning, scikit-learn, xgboost | 1,571,305,976 |
se_35714772 | stackoverflow | MACHINE_LEARNING | Sklearn Lasso Regression is orders of magnitude worse than Ridge Regression? | Sklearn Lasso Regression is orders of magnitude worse than Ridge Regression?
I've currently implemented Ridge and Lasso regression using the sklearn.linear_model module.
However, the Lasso Regression seems to do 3 orders of magnitude worse on the same dataset!
I'm not sure what's wrong, because mathematically, this sh... | https://stackoverflow.com/questions/35714772/sklearn-lasso-regression-is-orders-of-magnitude-worse-than-ridge-regression | python, machine-learning, scikit-learn, linear-regression | 1,456,806,983 |
se_41692017 | stackoverflow | MACHINE_LEARNING | Decision Trees combined with Logistic Regression | Decision Trees combined with Logistic Regression
Basically my question is related to the following paper (it is enough to read only sections 1.Introduction, beginning of section 3.Prediction model structure and section 3.1 Decision tree feature transforms, everything else could be skipped)
https://pdfs.semanticscholar... | https://stackoverflow.com/questions/41692017/decision-trees-combined-with-logistic-regression | machine-learning, classification, linear-regression, logistic-regression, decision-tree | 1,484,640,977 |
se_36051506 | stackoverflow | MACHINE_LEARNING | Difference between logistic regression and softmax regression | Difference between logistic regression and softmax regression
I know that logistic regression is for binary classification and softmax regression for multi-class problem. Would it be any differences if I train several logistic regression models with the same data and normalize their results to get a multi-class classi... | https://stackoverflow.com/questions/36051506/difference-between-logistic-regression-and-softmax-regression | algorithm, machine-learning, classification, logistic-regression, softmax | 1,458,187,728 |
se_23178275 | stackoverflow | MACHINE_LEARNING | Text classification in python - (NLTK Sentence based) | Text classification in python - (NLTK Sentence based)
I need to classify text and i am using Text blob python module to achieve it.I can use either Naive Bayes classifier/Decision tree. I am concern about the below mentioned points.
I Need to classify sentences as argument/ Not an argument. I am using two classifiers... | https://stackoverflow.com/questions/23178275/text-classification-in-python-nltk-sentence-based | python, machine-learning, nlp, text-classification | 1,397,966,487 |
se_74752325 | stackoverflow | MACHINE_LEARNING | binary classification:why use +1/0 as label, what's the difference between +1/-1 or even +100/-100 | binary classification:why use +1/0 as label, what's the difference between +1/-1 or even +100/-100
In binary classification problem, we usually use +1 for positive label and 0 for negative label. why is that? especially why use 0 rather than -1 for the negative label?
what's the difference between using -1 for ne... | https://stackoverflow.com/questions/74752325/binary-classification-why-use-1-0-as-label-whats-the-difference-between-1-1 | machine-learning | 1,670,670,301 |
se_79496192 | stackoverflow | MACHINE_LEARNING | I am having a error with shape alignment, how can I solve this? | I am having a error with shape alignment, how can I solve this?
This is the code for a self playing game with a feedforwrd only neural network. I am gettin a error with the shapes alignment and I'm not being able to solve it
setup.py:
import pygame
import os
import random
import numpy as np
pygame.init()
#constantes... | https://stackoverflow.com/questions/79496192/i-am-having-a-error-with-shape-alignment-how-can-i-solve-this | python, numpy, machine-learning, neural-network | 1,741,536,176 |
se_68116676 | stackoverflow | MACHINE_LEARNING | Model Load get different result after restart runtime | Model Load get different result after restart runtime
I have written a Resnet50 model using google colab. After train my model then saving models afterwards load model without restart run time get same result, but when restarting runtime google colab and running xtrain, ytest, x_val, y_val then loading model again, I ... | https://stackoverflow.com/questions/68116676/model-load-get-different-result-after-restart-runtime | python, tensorflow, machine-learning, neural-network | 1,624,541,112 |
se_77610686 | stackoverflow | MACHINE_LEARNING | Why does the one-hot-encoding give worse accuracy in this case? | Why does the one-hot-encoding give worse accuracy in this case?
I have two directories, train_data_npy and valid_data_npy where there are 3013 and 1506 *.npy files, respectively.
Each *.npy file has 11 columns of float types, of which the first eight columns are features and the last three columns are one-hot-encoded ... | https://stackoverflow.com/questions/77610686/why-does-the-one-hot-encoding-give-worse-accuracy-in-this-case | python, tensorflow, machine-learning, keras, auto-keras | 1,701,839,528 |
se_70239943 | stackoverflow | MACHINE_LEARNING | Error to import Network from keras.engine.topolgy | Error to import Network from keras.engine.topolgy
I installed the topology package by downgrading the keras (pip install 'keras==2.1.6' --force-reinstall), because it doesn't exist in newer versions. I am still getting an error to import Network.
Trying:
from keras.engine.topology import Network
Error:
ImportError: c... | https://stackoverflow.com/questions/70239943/error-to-import-network-from-keras-engine-topolgy | tensorflow, machine-learning, keras, deep-learning, tensorflow2.0 | 1,638,753,152 |
se_34532878 | stackoverflow | MACHINE_LEARNING | Package ‘neuralnet’ in R, rectified linear unit (ReLU) activation function? | Package ‘neuralnet’ in R, rectified linear unit (ReLU) activation function?
I am trying to use activation functions other than the pre-implemented "logistic" and "tanh" in the R package neuralnet. Specifically, I would like to use rectified linear units (ReLU) f(x) = max{x,0}. Please see my code below.
I believe I ca... | https://stackoverflow.com/questions/34532878/package-neuralnet-in-r-rectified-linear-unit-relu-activation-function | r, machine-learning, neural-network | 1,451,491,354 |
se_41244421 | stackoverflow | MACHINE_LEARNING | Linear vs nonlinear neural network? | Linear vs nonlinear neural network?
I know how to build a nonlinear classification model, but my current problem has a continuous output. I've been searching for information on neural network regression, but all I encounter is information on linear regression - nothing about nonlinear cases. Which is odd, because why ... | https://stackoverflow.com/questions/41244421/linear-vs-nonlinear-neural-network | machine-learning, neural-network | 1,482,243,437 |
se_2037832 | stackoverflow | MACHINE_LEARNING | semantic similarity between sentences | semantic similarity between sentences
I'm doing a project. I need any opensource tool or technique to find the semantic similarity of two sentences, where I give two sentences as an input, and receive score (i.e.,semantic similarity) as an output. Any help? | https://stackoverflow.com/questions/2037832/semantic-similarity-between-sentences | java, machine-learning, nlp | 1,263,144,584 |
se_64848149 | stackoverflow | MACHINE_LEARNING | split dataset into train and test using tensorflow | split dataset into train and test using tensorflow
How can I shuffle and split my full dataset into train and test sets using Tensorflow? I don't want to use scikit-learn's train-test-split. | https://stackoverflow.com/questions/64848149/split-dataset-into-train-and-test-using-tensorflow | tensorflow, machine-learning, train-test-split | 1,605,464,431 |
se_74151249 | stackoverflow | MACHINE_LEARNING | Bertopic assign topics to data frame | Bertopic assign topics to data frame
I have build a topic model with Bertopic.
After getting topic how could I assign them to dataset.
My main aim is to convert unsupervised topic modelling to supervised multi label classification problem. | https://stackoverflow.com/questions/74151249/bertopic-assign-topics-to-data-frame | python, machine-learning, nlp, bert-language-model, topic-modeling | 1,666,342,935 |
se_27860652 | stackoverflow | MACHINE_LEARNING | What is the concept of negative-sampling in word2vec? | What is the concept of negative-sampling in word2vec?
I'm reading the 2014 paper word2vec Explained: Deriving Mikolov et al.’s
Negative-Sampling Word-Embedding Method (note: direct download link) and it references the concept of "negative-sampling":
Mikolov et al. present the negative-sampling approach as a more effi... | https://stackoverflow.com/questions/27860652/what-is-the-concept-of-negative-sampling-in-word2vec | machine-learning, nlp, word2vec | 1,420,806,685 |
se_29393739 | stackoverflow | MACHINE_LEARNING | how to use GridSearchCV with custom estimator in sklearn? | how to use GridSearchCV with custom estimator in sklearn?
I have an estimator that should be compatible with the sklearn api. I am trying to fit one parameter of this estimator with gridsearchcv but I do not understand how to do it.
This is my code:
import numpy as np
import sklearn as sk
from sklearn.linear_model ... | https://stackoverflow.com/questions/29393739/how-to-use-gridsearchcv-with-custom-estimator-in-sklearn | python, machine-learning, scikit-learn | 1,427,899,173 |
se_33374010 | stackoverflow | MACHINE_LEARNING | Does Word2Vec has a hidden layer? | Does Word2Vec has a hidden layer?
When I am reading one of papers of Tomas Mikolov: http://arxiv.org/pdf/1301.3781.pdf
I have one concern on the Continuous Bag-of-Words Model section:
The first proposed architecture is similar to the feedforward NNLM, where the non-linear hidden layer is removed and the projectio... | https://stackoverflow.com/questions/33374010/does-word2vec-has-a-hidden-layer | machine-learning, nlp, neural-network, word2vec | 1,445,965,054 |
se_42080598 | stackoverflow | MACHINE_LEARNING | What is the best way to build and expose a Machine Learning model REST api? | What is the best way to build and expose a Machine Learning model REST api?
I have been working on designing REST api using springframework and deploying them on web servers like Tomcat. I have also worked on building Machine Learning model and use the model to make prediction using sklearn in Python.
Now I have a use... | https://stackoverflow.com/questions/42080598/what-is-the-best-way-to-build-and-expose-a-machine-learning-model-rest-api | java, python, rest, machine-learning, scikit-learn | 1,486,433,951 |
se_79486105 | stackoverflow | MACHINE_LEARNING | Inconsistent results when training models using different GPUs | Inconsistent results when training models using different GPUs
I've been trying to train a language model (text classification), our lab has two GPUs, a 4090 and a 3090. However, I encountered a perplexing phenomenon during training: the model's performance varies slightly when using different GPUs (or different GPU c... | https://stackoverflow.com/questions/79486105/inconsistent-results-when-training-models-using-different-gpus | machine-learning, pytorch, nvidia, text-classification | 1,741,169,404 |
se_71509883 | stackoverflow | MACHINE_LEARNING | Recovering features names of StandardScaler().fit_transform() with sklearn | Recovering features names of StandardScaler().fit_transform() with sklearn
Edited from a tutorial in Kaggle, I try to run the code below and data (available to download from here):
Code:
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np # linear algebra
import pandas as pd # data processing, CSV... | https://stackoverflow.com/questions/71509883/recovering-features-names-of-standardscaler-fit-transform-with-sklearn | python-3.x, machine-learning, scikit-learn, xgboost | 1,647,509,323 |
se_79484601 | stackoverflow | MACHINE_LEARNING | Android mediapipe second inference instance can't be initialized | Android mediapipe second inference instance can't be initialized
I do some experiments with google.mediapipe framework and observing next issue... if some instance/task was initialized, it's impossible to create another instance of inference task after.
For example, I run mediapipe task with pose detection model, ... | https://stackoverflow.com/questions/79484601/android-mediapipe-second-inference-instance-cant-be-initialized | android, tensorflow, machine-learning, mediapipe | 1,741,113,985 |
se_79485691 | stackoverflow | MACHINE_LEARNING | XGBoost does not predict properly on input that's equal to traning data | XGBoost does not predict properly on input that's equal to traning data
Why this quite simple example of XGBoost ML produces all-nulls even on input, that's equivalent to training data? This looks like a trivial case of input which should not require any fine tuning of ML, but even if I tweak hyperparams for ML (m... | https://stackoverflow.com/questions/79485691/xgboost-does-not-predict-properly-on-input-thats-equal-to-traning-data | python, machine-learning, xgboost | 1,741,157,959 |
se_79484194 | stackoverflow | MACHINE_LEARNING | Warning when loading the model because of Adam optimizer | Warning when loading the model because of Adam optimizer
I am implementing the following multi-task model with the following layers:
@tf.keras.utils.register_keras_serializable()
class Bcb_block(Layer):
def __init__(self, mid_chan, out_chan, data_format = 'channels_first', **kwargs):
super(Bcb_block, self)... | https://stackoverflow.com/questions/79484194/warning-when-loading-the-model-because-of-adam-optimizer | python, tensorflow, machine-learning, deep-learning, tf.keras | 1,741,103,282 |
se_79396860 | stackoverflow | MACHINE_LEARNING | Always getting ' Your input ran out of data' | Always getting ' Your input ran out of data'
I am trying to train a CNN model with an image dataset for medical image segmentation:
history = model.fit(x = train_dataset,
validation_data = val_dataset,
epochs= epochs,
steps_per_epoch= st... | https://stackoverflow.com/questions/79396860/always-getting-your-input-ran-out-of-data | python, tensorflow, machine-learning, keras | 1,738,156,541 |
se_34363250 | stackoverflow | MACHINE_LEARNING | Understanding Word2Vec's Skip-Gram Structure and Output | Understanding Word2Vec's Skip-Gram Structure and Output
I have a two-fold question about the Skip-Gram model in Word2Vec:
The first part is about structure: as far as I understand it, the Skip-Gram model is based on one neural network with one input weight matrix W, one hidden layer of size N, and C output weight... | https://stackoverflow.com/questions/34363250/understanding-word2vecs-skip-gram-structure-and-output | vector, machine-learning, nlp, word2vec | 1,450,469,528 |
se_49732976 | stackoverflow | MACHINE_LEARNING | what actually word embedding dimensions values represent? | what actually word embedding dimensions values represent?
I have a doubt in word2vec and word embedding, I have downloaded GloVe pre-trained word embedding (shape 40,000 x 50) and using this function to extract information from that:
import numpy as np
def loadGloveModel(gloveFile):
print ("Loading Glove Model")
... | https://stackoverflow.com/questions/49732976/what-actually-word-embedding-dimensions-values-represent | machine-learning, nlp, word2vec, word-embedding | 1,523,276,842 |
se_29381505 | stackoverflow | MACHINE_LEARNING | Why does word2vec use 2 representations for each word? | Why does word2vec use 2 representations for each word?
I am trying to understand why word2vec's skipgram model has 2 representations for each word (the hidden representation which is the word embedding) and the output representation (also called context word embedding) . Is this just for generality where the context c... | https://stackoverflow.com/questions/29381505/why-does-word2vec-use-2-representations-for-each-word | machine-learning, nlp, word2vec | 1,427,852,681 |
se_79478755 | stackoverflow | MACHINE_LEARNING | What is the box constraint in the output of a support vector machine in matlab? | What is the box constraint in the output of a support vector machine in matlab?
In matlab, the function fitcsvm trains a support vector machine.
In output, there is a component BoxConstraints. I have read the post this post
and understood the meaning of box constraint.
But in the answer of the post, the box constraint... | https://stackoverflow.com/questions/79478755/what-is-the-box-constraint-in-the-output-of-a-support-vector-machine-in-matlab | matlab, machine-learning, svm | 1,740,901,203 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.