Comments (4)
Hi @Jee-King
Yes, this is correct. I think it would be better to instead sum up the number of events per time index instead. Of course, then the SNN pipeline must support this and I don't remember if Slayer does right now.
from snn_angular_velocity.
Hi, thanks for your reply!
I am reproducing the training process according to the paper. I use the MSE loss function instead of the function described in the paper. But I got a bad performance. Does the MSE loss function have a decisive effect on the results? By the way, could you provide the source code of the loss function in the paper?
from snn_angular_velocity.
I don't think that you will see a big difference if you use a slightly different loss. The challenge of training this SNN lies mostly in making sure that you have gradients for all layers. I used the following loss:
class RMSELoss:
def __init__(self):
self.str_to_idx = {
'x': 0,
'y': 1,
'z': 2,
}
def compute(self, input_: torch.Tensor, target: torch.Tensor, time_start_idx: int=None, axis: str=None):
assert len(input_.shape) == 3
assert len(target.shape) == 3
assert input_.shape == target.shape
assert input_.shape[1] == 3
"""
:param input: tensor of shape (batch, 3, time)
:param target: tensor of shape (batch, 3, time)
:param time_start_idx: Time-index from which to start computing the loss
:param axis: {'x', 'y', 'z'}
:return: Root mean squared error
"""
if axis:
axis_idx = self.str_to_idx[axis]
input_ = input_[:, axis_idx, :]
target = target[:, axis_idx, :]
if time_start_idx:
input_ = input_[..., time_start_idx:]
target = target[..., time_start_idx:]
return torch.mean(torch.sqrt(torch.mean((input_ - target) ** 2, dim=1)))
from snn_angular_velocity.
Thank you very much for your help!
from snn_angular_velocity.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snn_angular_velocity.