I have already trained gensim doc2Vec model, which is finding most similar documents to an unknown one. Now I need to find the similarity value between two unknown documents (which were not in the training data, so they can not be referenced by doc id) in the code above vec1 and vec2 are successfully initialized to some values and of
Tag: machine-learning
Keras CNN Error: expected Sequence to have 3 dimensions, but got array with shape (500, 400)
I’m getting this error: ValueError: Error when checking input: expected Sequence to have 3 dimensions, but got array with shape (500, 400) These are the below codes that I’m using. Output (here I’ve 500 rows in each): Code: Any insights? Answer Two things – Conv1D layer expects input to be in the shape (batch_size, x, filters), in your case (500,400,1).
Keras: Adding MDN Layer to LSTM Network
My question in brief: Is the Long Short Term Memory Network detailed below appropriately designed to generate new dance sequences, given dance sequence training data? Context: I am working with a dancer who wishes to use a neural network to generate new dance sequences. She sent me the 2016 chor-rnn paper that accomplished this task using an LSTM network with
Difference between Standard scaler and MinMaxScaler
What is the difference between MinMaxScaler() and StandardScaler(). mms = MinMaxScaler(feature_range = (0, 1)) (Used in a machine learning model) sc = StandardScaler() (In another machine learning model they used standard-scaler and not min-max-scaler) Answer From ScikitLearn site: StandardScaler removes the mean and scales the data to unit variance. However, the outliers have an influence when computing the empirical mean
What does calling fit() multiple times on the same model do?
After I instantiate a scikit model (e.g. LinearRegression), if I call its fit() method multiple times (with different X and y data), what happens? Does it fit the model on the data like if I just re-instantiated the model (i.e. from scratch), or does it keep into accounts data already fitted from the previous call to fit()? Trying with LinearRegression
Mask R-CNN for object detection and segmentation [Train for a custom dataset]
I’m doing a research on “Mask R-CNN for Object Detection and Segmentation”. So I have read the original research paper which presents Mask R-CNN for object detection, and also I found few implementations of Mask R-CNN, here and here (by Facebook AI research team called detectron). But they all have used coco datasets for testing. But I’m quite a bit
Save and load model optimizer state
I have a set of fairly complicated models that I am training and I am looking for a way to save and load the model optimizer states. The “trainer models” consist of different combinations of several other “weight models”, of which some have shared weights, some have frozen weights depending on the trainer, etc. It is a bit too complicated
Python SKLearn: How to Get Feature Names After OneHotEncoder?
I would like to get the feature names of a data set after it has been transformed by SKLearn OneHotEncoder. In active_features_ attribute in OneHotEncoder one can see a very good explanation how the attributes n_values_, feature_indices_ and active_features_ get filled after transform() was executed. My question is: For e.g. DataFrame based input data: How does the code look like
How do you use Keras LeakyReLU in Python?
I am trying to produce a CNN using Keras, and wrote the following code: I want to use Keras’s LeakyReLU activation layer instead of using Activation(‘relu’). However, I tried using LeakyReLU(alpha=0.1) in place, but this is an activation layer in Keras, and I get an error about using an activation layer and not an activation function. How can I use
ValueError: special directives must be the first entry
why this error appears and what does it mean exactly? It appears on this code (I put only the part of machine learning, because the code is so long): The error is the following: Thank you in advance! Answer Looking at what the code is doing I don’t think you should have np.c_ there at all. The model is trained