Skip to content
Advertisement

Tag: arrays

keras lstm error: expected to see 1 array

so i want to make a lstm network to run on my data but i get this message: ValueError: Error when checking input: expected lstm_1_input to have shape (None, 1) but got array with shape (1, 557) this is my code: Answer You need to change the input_shape value for LSTM layer. Also, x_train must have the following shape. So,

Finding the minimum of the N numpy matrices?

I want to find the minimum of N numpy matrices elementwise (but with a twist, read till the end). To show, I create 3 numpy matrices as follows: I except my output d to be: I also need to retain the information from where does the each element in the d matrix is coming from. So if I label a,

Is there a way to create array with custom values using numpy array

Hello i want to ask is there a way to create an array with custom values without using loop and assign the values for example i want to create array with [2,1] shape and i want to fill the first column with value of (-1) and the second with value of (2) i have read the numpy docs “https://docs.scipy.org/doc/numpy-1.13.0/reference/routines.array-creation.html” but

Finding Subarrays of Vowels from a given String

You are given a string S, and you have to find all the amazing substrings of S. Amazing Substring is one that starts with a vowel (a, e, i, o, u, A, E, I, O, U). Input The only argument given is string S. Output Return a single integer X mod 10003, here X is number of Amazing Substrings in

Advertisement