Category "machine-learning"

tensorflow_probability: TransformedDistribution not accepting event_shape and batch_shape arguments

In version 0.11.0 of Tensorflow Probability, I can define a TransformedDistribution as follows, indicating event and batch shape: mvn = tfd.TransformedDistribut

tensorflow_probability: TransformedDistribution not accepting event_shape and batch_shape arguments

In version 0.11.0 of Tensorflow Probability, I can define a TransformedDistribution as follows, indicating event and batch shape: mvn = tfd.TransformedDistribut

Difference between cosine similarity and cosine distance

It looks like scipy.spatial.distance.cdist cosine similariy distance: link to cos distance 1 1 - u*v/(||u||||v||) is different from sklearn.metrics.pairwis

AUC-ROC value with confident intervals

AUC-ROC value always generates a plus or minus value. What does this bold color value mean? And how can we identify the confident interval of this value? 0.74 &

ValueError: Exception encountered when calling layer "sequential_5" (type Sequential)

I am following this course : TensorFlow Developer Certificate in 2022: Zero to Mastery This is the following code : # Set random seed tf.random.set_seed(42) #

How are the TokenEmbeddings in BERT created?

In the paper describing BERT, there is this paragraph about WordPiece Embeddings. We use WordPiece embeddings (Wu et al., 2016) with a 30,000 token vocab

SHAP Summary Plot and Mean Values displaying together

Used the following Python code for a SHAP summary_plot: explainer = shap.TreeExplainer(model2) shap_values = explainer.shap_values(X_sampled) shap.summary_plot

Adding Dropout Layers to Segmentation_Models Resnet34 with Keras

I want to use the Segmentation_Models UNet (with ResNet34 Backbone) for uncertainty estimation, so i want to add some Dropout Layers into the upsampling part. T

How to plot the pricipal vectors of each variable after performing PCA?

My question mainly comes from this post :https://stats.stackexchange.com/questions/53/pca-on-correlation-or-covariance In the article, the author plotted the v

How to Vectorize python function

I have made a resume parser but to parse my resumes, I am using a for loop to run my parse function over each resume. Is there a way to vectorize this approach?

How to get rid of the KeyError: 'names'

I was trying to make a program that can make classification between runway and taxiway using mask rcnn. after importing custom dataset in json format I am getti

How to acquire tf.data.dataset's shape?

I know dataset has output_shapes, but it shows like below: data_set: DatasetV1Adapter shapes: {item_id_hist: (?, ?), tags: (?, ?), client_platform: (?,), en

Changing label names of Kmean clusters

I am doing the kmean clustering through sklearn in python. I am wondering how to change the generated label name for kmean clusters. For example: data

How to add a new row after every unique entries in pandas dataframe

I have to add a new row at the end of each person information. In the new row which we will add all the information will be same as last row like name, last_upd

How to do gradient clipping in pytorch?

What is the correct way to perform gradient clipping in pytorch? I have an exploding gradients problem.

Invocation timed out using Sagemaker to invoke endpoints with pretrained custom PyTorch model [Inference]

I have a pretrained model based on PyTorch (contextualized_topic_models) and have deployed it using AWS sagemaker script model. However, when I tried to invoke

When using padding in sequence models, is Keras validation accuracy valid/ reliable?

I have a group of non zero sequences with different lengths and I am using Keras LSTM to model these sequences. I use Keras Tokenizer to tokenize (tokens start

ImportError: No module named grid_search, learning_curve

Problem with Scikit learn l can't use learning_curve of Sklearn and sklearn.grid_search. When l do import sklearn (it works) from sklearn.cluster import biclus

How to set the parameters grids correctly when tuning the workflowset with tidymodels?

I try to use tidymodels to tune the workflow with recipe and model parameters. When tuning a single workflow there is no problem. But when tuning a workflowsets

ValueError: hist method requires numerical columns, nothing to plot

I was going through a tutorial, but as I was running the code in an IDE, an error occurred. The link to the tutorial is here: https://thecleverprogrammer.com/20