Questions tagged [zero-padding]

The practice of padding a number (or string) with zeros in order to match an expected number of characters or bytes.

The practice of padding a number (or string) with zeros in order to match an expected number of characters or bytes.

For example, if the expected length of a string is 6, the number '123' could be zero padded as '000123' in order to meet this expected length.

111 questions
1
vote
1 answer

In tensorflow, Do I have to set something special to ignore zero padding value when training? Or is it automatic?

I want to train sequence data to Rnn base model with some zero paddings using tensorflow. And I want model to ignore 0 values when training. Do I have to set parameters to do that? or Does model automatically ignore zeros? Thanks,,
1
vote
1 answer

SQLite3 - Calculated SELECT with padding and concatenation

I have the following SQLite table (a stub of the real table which has a few other columns) CREATE TABLE IF NOT EXISTS fingers(id INTEGER,intLL INTEGER,fracLat INTEGER,fracLng INTEGER,PRIMARY KEY(id)) WITHOUT ROWID; A typical entry in this table…
DroidOS
  • 8,530
  • 16
  • 99
  • 171
1
vote
0 answers

Fast Fourier Transform(FFT) - problem with fourier resolution

I have been working quite a bit with fourier transforms in python the last couple of days. I have discovered that in order to accurately capture known periods of incoming data, the resolution or spacing of the x-axis (1/n_samples) has to be…
1
vote
0 answers

Python Fourier zero padding

Problem I have a spectrum that can be download here: https://www.dropbox.com/s/ax1b32aotuzx9f1/example_spectrum.npy?dl=0 Using Python, I am trying to use zero padding to increase the number of points in the frequency domain. To do so I rely on…
paulo
  • 65
  • 6
1
vote
1 answer

Moving Filter/Mask Across Given Image (No Function)

I am struggling attempting to create a program that pads an image and filter/mask. Where I am having trouble is actually attempting to move this filter over each bit of the image without using a function to do so. Here is what I have so far. L=256;…
1
vote
2 answers

Same padding when kernel size is even

When the kernel size is odd, we can manually calculate the necessary padding to get the output in the same dimension as input such that it creates same padding. But how can we calculate padding dimensions for kernels with even sizes (ex: (2x2)?
1
vote
1 answer

Pandas - Drop NaN's per column and pad with 0 fast?

I have a data frame such as the following with tens of thousands of rows and a thousand columns: For an LSTM, I would like to extract the values only per column, put them together at the beginning of the dataframe and pad 0 before the values start…
Stefan
  • 25
  • 3
1
vote
1 answer

Concatenation Breaks Numbers with Padded Zeros in SQL Server

I have some non-working code to concatenate two strings, one of which is a year value and the other is a month value, both of which I convert to strings from integers. The month further needs padded with leading zeros (January is 01, not 1). So,…
PBJ
  • 354
  • 2
  • 15
1
vote
1 answer

How to pad tensors of different shape to make them of same shape for 2nd dimension

I have 3 tensors with shape (100,43,1024), (100,37,1024) and (100,42,1024). I want to make the second dimension of all these tensors to the maximum value of 2nd dimension i.e 43 in this case. Could you plz help me how to use pad function to make…
Aizayousaf
  • 39
  • 15
1
vote
1 answer

Confusion around alignment and padding of strings in .rodata

Taking this simple C program const char s1[] = "hello", s2[] = "there"; and compiling it using gcc -c a.c -O0 -o a.o yields in .rodata containing the following: 'hello\x00there\x00' , which is what I expect. Each of the strings occupy 6…
bool3max
  • 2,748
  • 5
  • 28
  • 57
1
vote
1 answer

Clip or threshold a tensor using condition and zero pad the result in PyTorch

let's say I have a tensor like this w = [[0.1, 0.7, 0.7, 0.8, 0.3], [0.3, 0.2, 0.9, 0.1, 0.5], [0.1, 0.4, 0.8, 0.3, 0.4]] Now I want to eliminate certain values base on some condition (for example greater than 0.5 or not) w = [[0.1, 0.3], …
omer sahban
  • 77
  • 1
  • 8
1
vote
2 answers

Numpy array: how to undo zero-padding without copying array?

I am working on 3D image segmentation with deep learning. Basically, I need to 1/ pad a numpy array, 2/ process the array, 3/ unpad the array. dataArray = np.pad(dataArray, 25, mode='constant', constant_values=0) # pad processedArray =…
Manu
  • 186
  • 3
  • 11
1
vote
1 answer

PHP REGEX: how to pad numbers in the middle/end of a string

i have a list of key=>value pairs from a JSON squirt. i sorted the array and i'm left with the following (excerpted relevant cases because they go as high as…
WhiteRau
  • 818
  • 14
  • 32
1
vote
0 answers

Tensorflow padding='SAME' applied before/after the convolutional operation

When using TF's Conv2D layer with padding='SAME', i.e., expecting the output to be in the same 2D shape as the input, does it first pad the input with zeros and then proceeds to the convolution, or does it first compute the convolution on the input…
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126
1
vote
2 answers

Haskell: Merging a list where even indices are from list 1 and odd are from list 2. Fill with 0's if not the same size

i've tried to create a Haskell function that is merging 2 lists into a single list, where even indices in the new list are from list 1 and the odd are from list 2. Fill with 0's if not the same size. For example: [1] [10,15,20] => [1,10,0,15,0,20]…
user6351755
  • 21
  • 1
  • 6