I am building a CNN for non image data in Keras 2.1.0 on Window 10.
My input feature is a 3x12 matrix of non negative number and my output is a binary multi-label vector with length 6x1
And I was running into this error expected conv2d_14_input to…
I am trying to find the minimum value in an N-dimensional array spanned by (N-Parameters of varying values) and take out a 2-dimensional array spanned by 2 of the (N-Parameters) around the minimum value to make a contour plot.
I can do this by hard…
Let's say I have a 4d array A with shape (D0, D1, D2, D3). I have a 1d array B with shape (D0,), which includes the indices I need at axis 2.
The trivial way to implement what I need:
output_lis = []
for i in range(D0):
output_lis.append(A[i, :,…
how to extract specific rows in tensor? I'm a little confused.
for example, let's say we want to have row 17
specified row
import numpy as np
np.random.seed(seed = 5)
a = np.random.randint(10, size=(2,3,4,5))
a
So I am trying to refresh my knowledge. I tried finding the answer to this question here and I am not still not sure how to answer this.
Basically if I have a 2D index array (call it a) of shape (x, z) and a 3D array (call it b) of shape (x, y, z),…
I have a numpy array of shape (206, 482, 3). I wanted to pick the 1st channel so I used name_of_array[:][:][0] but apparently that doesn't select the 1st channel.
I think name_of_array[:,:,0] picks the 1st channel. I don't understand why. Why…
I need the mean along the time axis of array (1), using numpy.
The catch: it's not going to be the mean of all values along this axis, but rather a subset that starts at an index that is given in array (2).
The arrays I'm working with:
(array1) 3…
Say I have this array of data
data = np.asarray([[1, 2, 3, 4], ['a', 'b', 'c', 'd'], ['A', 'B', 'C', 'D'], ['x', 'y', 'z', 'zz']])
and these indices, each "pair" corresponding to one cell in the data matrix
indices = np.asarray([[0, 0], [3, 0], [2,…
I intend to create mini-batches for my deep learning neural network program, from a training set consisting 'm' number of examples. I have tried:
# First Shuffle (X, Y)
permutation = list(np.random.permutation(m))
shuffled_X = X[:,…
Basically I want to simply a function like this:
arr = np.array([[0.2, 0.4], [-0.9, -0.8]])
def take_dimension(arr, dim=None):
"""dim is either None, 0 or 1"""
# return array with specific dimension
if dim is not None:
…
Hey guys this question might be more about logic than code, hopefully someone can light it up.
So, I have a data list that contains some outliers, and I want to remove it by using the difference between each item on the list and identifying where…
I am not able to figure what out what is wrong with this piece of code. Could you please help me understand what is going wrong and how to fix it?
import numpy as np
T =…
I'm trying to split a dataset into train and test groups in Python using a method similar to what I'm used to in R (I realize there are other options). So I'm defining an array of row numbers that will make up my train set. I then want to grab the…
I haven't use numpy to his full potential yet. I have this pretty huge 3d array (700000 x 32 x 32). All of the values are int between 1 and 4. I want to be able to filter the array so that the I get a same shape array, but only with 1 for values of…
I'm confused about the way numpy array slicing is working in the example below. I can't figure out how exactly the slicing is working and would appreciate an explanation.
import numpy as np
arr = np.array([
[1,2,3,4],
[5,6,7,8],
…