Questions tagged [timestep]

36 questions
16
votes
1 answer

What exactly is timestep in an LSTM Model?

I am a newbie to LSTM and RNN as a whole, I've been racking my brain to understand what exactly is a timestep. I would really appreciate an intuitive explanation to this
Steven Wang
  • 335
  • 1
  • 2
  • 7
14
votes
4 answers

Pandas: extract hour from timedelta

This answer explains how to convert integers to hourly timesteps in Pandas. I need to do the opposite. My dataframe df1: A 0 02:00:00 1 01:00:00 2 02:00:00 3 03:00:00 My expected dataframe df1: A B 0 02:00:00 2 1 01:00:00 1 2 …
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
2
votes
1 answer

Is it possible to update funcion variables every time it's been called?

I'm trying to solve an ODE system with solve_ivp and i want to change the local variables of the function every time it's been called by the solver. In particular I wand to update the lagrange multipliers (lambdas_i) so that the next time step of…
2
votes
1 answer

Variation in Time Step Size does not affect the simulation results in Dymola

I am working on a model of hot water storage developed in Buildings library of Modelica. Using Dymola to simulate the model by Dassl, I changed time step of simulation from 1s to 1200s, but I have not seen any change in simulation result. Is it…
AJodeiri
  • 314
  • 2
  • 8
2
votes
0 answers

Adding dropout between time-steps in pytorch RNN

I am training built-in pytorch rnn modules (eg torch.nn.LSTM) and would like to add fixed-per-minibatch dropout between each time step (Gal dropout, if I understand correctly). Most simply, I could unroll the network and compute my forward…
gail
  • 65
  • 7
2
votes
1 answer

Input Data preparation for LSTM in Keras/Tensorflow

The input shape of an LSTM layer is (batch_size, timesteps, features). I currently have an input that looks like this: [0,1,2,3,4,5,6,7,8,9,10] I use my code to reshape the data so it looks like…
JonathanSchmied
  • 137
  • 1
  • 7
1
vote
3 answers

How to calculate the frame timestep/deltatime in an MTKView?

I want to get the time since the last frame (known as the timestep or deltatime) in the draw method of MTKView. I expect to see values of approximately 0.017 assuming 60 frames per second consistently. The value should rise to about 0.03 if…
user16217248
  • 3,119
  • 19
  • 19
  • 37
1
vote
1 answer

step doubling Runge Kutta implementation stuck shrinking stepsize to machine precision

I need to integrate a system of ODES using an adaptive RK4 method with stepsize control via step doubling techniques. The problem is that the program continues forever shrinking the stepsize down to machine precision while not advancing time. the…
1
vote
1 answer

NCO: is there any one-line command to change the index of time dimension as a whole array (not by for-loop)?

I have a netCDF file FORCING.nc containing dimension "time" with values like: [ 841512., 841513., 841514., ..., 1051893., 1051894.,1051895.]. But I want to change the time stamps from the absolute value to relative values starting from 841512, say…
Xu Shan
  • 175
  • 3
  • 11
1
vote
2 answers

Is there an NCO command to change the time stamp of a variable in a netcdf?

I have a netcdf file containing maximum daily air temperature, time, lat and lon. I successfully got maximum temperature from a netcdf of 6 hourly temperatures using the nco command: ncra -y max --mro -d time,,,4,4 6hourly.nc max.nc" The only…
1
vote
1 answer

Python3.7 function to plot datetime from timestep of netCDF4

I need to plot bg variable from netcdf file, however the time is expressed as time-step. I read the netcdf file: data =netCDF4.Dataset (r'D:\Users\NOAA\\CT2019B.molefrac_components_glb3x2_2014-2018.nc') time = data.variables['time'][:] bg = …
frank
  • 89
  • 5
1
vote
0 answers

ValueError: Can not squeeze dim[1], expected a dimension of 1

EDIT: I got past that error message by reshaping my data as follows: train_x = np.array(train_x) train_y = np.array(train_y) x_size = train_x.shape[0] * train_x.shape[1] train_x = train_x.reshape(x_size, train_x.shape[2]) train_x…
maeven
  • 21
  • 4
1
vote
1 answer

Regularizing viscosity with scipy's ode solvers

Consider for the sake of simplicity the following equation (Burgers equation): Let's solve it using scipy (in my case scipy.integrate.ode.set_integrator("zvode", ..).integrate(T)) with a variable time-step solver. The issue is the following: if we…
1
vote
1 answer

MySQL Median value by session length by group (hours)

I need to calculate the median of user session length (ts_last-ts_first) by days (ts_first) in MySQL. Trying something like this but it does not work. Thanks! SET @row_number:=0; SET @medin_group:=’’; SELECT @row_number:=CASE WHEN @median_group=…
1
vote
0 answers

How do I backpropagate gradients onto the input of time step 1 in an LSTM network in Tensorflow?

In Tensorflow, I feed a matrix X of input vectors into an LSTM network. The first vector of the input matrix (time step 1) is a one-hot encoded vector, whereas the following vectors of X (following time steps) are zero vectors. Now, I want to…
SaTra
  • 11
  • 2
1
2 3