yuyolshin / AIS-ACNet

4 stars 1 forks source link

What do the four dimensions of the input data represent? #1

Open zhangbingac opened 3 months ago

zhangbingac commented 3 months ago

trainx = batch[0].to(device) trainx = trainx.permute(0, 3, 1, 2)[:, :args.in_dim, ...]

yuyolshin commented 3 months ago

The first two dimensions are the latitude and longitude of the vessels. The third is the speed over ground (SOG), and the fourth is the course over ground (COG).

zhangbingac commented 3 months ago

Sorry, I may not express it clearly, I mean trainx(batch_size,”?“, trajectory length, number of trajectory features), What does ”?“ represent? Is it the number of trajectories at the same time?

yuyolshin commented 3 months ago

Oh, sorry that I misunderstood your question. The dimensions for input tensors are [batch_size, # vessels, trajectory length, # features]. Since the number of vessels is different for every time step, the num. vessel dimension for each batch is set to the num. vessel for the time step with the maximum number of vessels. For example, if the number of vessels at t=1 is 20, the number of vessels at t=2 is 10, and the batch size is 2, the input dimension would be (2, 20, traj. length, # features). And trainx[2, 11:20, :, :] will be masked with 0. Also note that the dimension can be different for different batches. Please let me know if the explanation is still unclear.

zhangbingac commented 2 months ago

Thanks for your reply, I understand what you mean. I have another question, when we actually use the model for trajectory prediction, for example, if there is only one trajectory data, then the input dimensions are [batch_size=1, # vessels=1, trajectory length=15, # features=4]?