KalmanNet / KalmanNet_TSP

code for KalmanNet
287 stars 76 forks source link

Run Training and Inference based on custom dataset #5

Closed sotomotocross closed 1 year ago

sotomotocross commented 2 years ago

First of all, thank you very much for your nice work!

I am trying to construct an application based on your algorithm. I want to nonparametrically run an EKF based on your hybrid system. I have the assumption of the model-based case, but i haven't yet understand the dataset generation.

How can we run training and validation with a custom dataset which we have generate. And also what is the .pt file format? Do you produce it with a specific way?

XiaoyongNI commented 2 years ago

Hi,

Glad to see applications based on our work!

For the dataset generation, please check the GenerateBatch() function in Extended_sysmdl.py file. It's just normal .pt file generated by pytorch.

If you want to train and validate on a custom dataset, the easiest way is to adapt your data to the form of a list [train_input, train_target, cv_input, cv_target, test_input, test_target] in those main files. Specifically, for the elements inside the list, the ".._input" are torch tensors with size (#of trajectories, observation dimension n, trajectory length T), while ".._target" are torch tensors with size (#of trajectories, state dimension m, trajectory length T).

adityag6994 commented 3 months ago

Hi @XiaoyongNI ,

First of all, Great Work! I'm trying to understand how to input data for training to network. I'm not able to get why are we adding noise to the target input xt = torch.add(xt,eq) in GenerateBatch function. I can understand we add it in the observation part, self.Input[:, :, t] = torch.squeeze(yt,2) but not clear why do we add it in target self.Target[:, :, t] = torch.squeeze(xt,2), shouldn't target be always noise free and without the use of Q i.e. noise-free. Is there something I'm missing ?

XiaoyongNI commented 3 months ago

Hi,

Thanks for your interest in our work!

The noise Q you mentioned is part of the state space model that tries to charaterize the evolution of states in a time series. You could learn more details through search "state space model".