Testing model use our own dataset
I want to ask how to use the weights to be applied to our own dataset? Thank you
Hi riokt. By using the weights to apply to your dataset, do you mean to train DT on the dataset provided here and test it on a different dataset? If your test data distribution is different from the training one I doubt you will get good performance. Why not train DT directly on your dataset in order to provide it with relevant data? Either way, once the model is trained and weights saved under X.dat, you can load and use them in the following way:
w:copy(torch.load('X.dat')) where w are the weights of your model: w, dw = step:getParameters()
you can find this in train.lua at lines 76 and 81.
does this answer your question? don't hesitate to ask if anything else is unclear
Hi, I've been trying to understand data format in order to create a new dataset to test.
When I load the file you provide ('data.t7') , I get a 1'000'000x751 matrix. Reading the code I understand this means 10'000 sequences of length 100. But then, each time step is a 751 1d vector? I thought it should be 50x50...
And what's the meaning of each entry (I see a lot of infs and 27.7, 30, ...) ?
Finally, when you're dropping part of your sequence, are you alternating 10 empty every 10 real measurements? In this case then the prediction is every 20 time steps?
Thank you!
Hi mriberodiaz, thanks for your message.
yes you drop 10 frames (e.g 1 to 10) and predict the next 10 frames (e.g 11 to 20) so the prediction is done every 20 steps, for 10 steps.
when you load 'data.t7' you indeed get 10^6 laser scans of size 1x751. The values you see in this vectors of size 1x751 are the return values of the laser - if you have an actual value (e.g 23.4) this means that there is an object at distance 23.4 from the laser at the scan value. If there is an Inf value that means that there is no return and so the whole ray represents free space. Each laser scan has 751 returns and spans the whole 360 degree field. The class SensorData says how to map those 751 scans onto the grid. When you call LoadSensorData you create a grid. Here, the parameters of the grid are:
- grid of size 51x51
- x is horizontal, and the grid goes from -25 to 25
- y is vertical going down (opencv convention) , and goes from -45 to +5.
The laser is situated at position (0,0). So if you look at the grid, the laser is in the bottom middle part of the grid. I would suggest you create a grid of size 51x51 and fill it with the coordinates px/py of lines 54-55 in SensorData to visualise more easily.
Every laser scan of size 751 needs to be mapped onto the grid to create the visibility/occupancy/occluded parts of the scene. To do so, you need to figure out through which grid cell every laser scan passes through. Line 56 of SensorData calculates the angle of each grid cell in the laser coordinates system. Line 57 figures out which laser scan has the same angle as each grid cell. Here we consider that the laser scan angles span 360 degrees and are separated by 0.5 degree.
I would recommend running train.lua until line 61 where you create your data objet. I would then print/save data.index and data.dist matrices and visualise them (either using the torch image package or the torch interface to matlab). This will give you a visualisation of what these two matrices represent. Again, data.index tells you how to map the laser onto the grid, and it should draw a circle around the laser coordinate (0,0)
How to know if a cell is occupied, free or occluded is calculated when you call data[i] (this calls the index method in SensorData line 35-40). Basically, you copy the laser returns onto the grid using the data.index matrix (line 36 of SensorData). Again, I recommend printing and visualising the returned matrix dist to visualise what this means. It copies the value of the laser return all along the ray on the grid. For every grid point, you then compare the distance of that grid point to the laser (as given by self.dist) to the value of the laser return which passes through that grid (so the grid cell lies along the path of that laser ray). If the distance of the grid cell is LOWER than the value of the laser return, that cell is VISIBLE (the object on which the laser bounces is in a cell further away than the cell considered). And vice versa. This calculation is done on lines 38-39.
Again, I would suggest visualising all these matrices and follow the calculation with a pen and paper to draw out what is being done to better understand how the mapping is done.
If you then want to have your own data: create a grid with moving objects. Place a simulated sensor on that grid and create a synthetic laser scan (it can be of whichever size you want, you just need to know how spaced out your laser scans are in terms of angles, and modify the sensor_step accordingly). Then make sure that the axes of your grid/laser are the same in your simulated data and in torch, so that the mapping goes the right way. Again, printing and visualising matrices along the way will be of great help
sorry for the long reply, i hope this helps but I do realise it's not the best way to explain with words
Hi Djulee, I really appreciate your answer. Thank you very much, now everything is more clear; indeed, it helps me a lot!
2017-11-22 6:05 GMT-06:00 DjuLee [email protected]:
Hi mriberodiaz, thanks for your message.
yes you drop 10 frames (e.g 1 to 10) and predict the next 10 frames (e.g 11 to 20) so the prediction is done every 20 steps, for 10 steps.
when you load 'data.t7' you indeed get 10^6 laser scans of size 1x751. The values you see in this vectors of size 1x751 are the return values of the laser - if you have an actual value (e.g 23.4) this means that there is an object at distance 23.4 from the laser at the scan value. If there is an Inf value that means that there is no return and so the whole ray represents free space. Each laser scan has 751 returns and spans the whole 360 degree field. The class SensorData says how to map those 751 scans onto the grid. When you call LoadSensorData you create a grid. Here, the parameters of the grid are:
- grid of size 51x51
- x is horizontal, and the grid goes from -25 to 25
- y is vertical going down (opencv convention) , and goes from -45 to +5.
The laser is situated at position (0,0). So if you look at the grid, the laser is in the bottom middle part of the grid. I would suggest you create a grid of size 51x51 and fill it with the coordinates px/py of lines 54-55 in SensorData to visualise more easily.
Every laser scan of size 751 needs to be mapped onto the grid to create the visibility/occupancy/occluded parts of the scene. To do so, you need to figure out through which grid cell every laser scan passes through. Line 56 of SensorData calculates the angle of each grid cell in the laser coordinates system. Line 57 figures out which laser scan has the same angle as each grid cell. Here we consider that the laser scan angles span 360 degrees and are separated by 0.5 degree.
I would recommend running train.lua until line 61 where you create your data objet. I would then print/save data.index and data.dist matrices and visualise them (either using the torch image package or the torch interface to matlab). This will give you a visualisation of what these two matrices represent. Again, data.index tells you how to map the laser onto the grid, and it should draw a circle around the laser coordinate (0,0)
How to know if a cell is occupied, free or occluded is calculated when you call data[i] (this calls the index method in SensorData line 35-40). Basically, you copy the laser returns onto the grid using the data.index matrix (line 36 of SensorData). Again, I recommend printing and visualising the returned matrix dist to visualise what this means. It copies the value of the laser return all along the ray on the grid. For every grid point, you then compare the distance of that grid point to the laser (as given by self.dist) to the value of the laser return which passes through that grid (so the grid cell lies along the path of that laser ray). If the distance of the grid cell is LOWER than the value of the laser return, that cell is VISIBLE (the object on which the laser bounces is in a cell further away than the cell considered). And vice versa. This calculation is done on lines 38-39.
Again, I would suggest visualising all these matrices and follow the calculation with a pen and paper to draw out what is being done to better understand how the mapping is done.
If you then want to have your own data: create a grid with moving objects. Place a simulated sensor on that grid and create a synthetic laser scan (it can be of whichever size you want, you just need to know how spaced out your laser scans are in terms of angles, and modify the sensor_step accordingly). Then make sure that the axes of your grid/laser are the same in your simulated data and in torch, so that the mapping goes the right way. Again, printing and visualising matrices along the way will be of great help
sorry for the long reply, i hope this helps but I do realise it's not the best way to explain with words
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pondruska/DeepTracking/issues/5#issuecomment-346331528, or mute the thread https://github.com/notifications/unsubscribe-auth/AeCcNCUu2xTD-yqvPpEK5uvJcnF7wqi_ks5s5A4mgaJpZM4Pv-Ka .