Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
def generate_signal(length_seconds, sampling_rate, frequencies_list, func="sin", add_noise=0, plot=True): | |
r""" | |
Generate a `length_seconds` seconds signal at `sampling_rate` sampling rate. See torchsignal (https://github.com/jinglescode/torchsignal) for more info. | |
Args: | |
length_seconds : int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=1, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=2, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=3, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=3, padding=1, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=5, padding=2, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=3, stride=3, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=1, out_channels=1, kernel_size=3, dilation=2, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestConv1d(nn.Module): | |
def __init__(self): | |
super(TestConv1d, self).__init__() | |
self.conv = nn.Conv1d(in_channels=2, out_channels=2, kernel_size=1, groups=2, bias=False) | |
self.init_weights() | |
def forward(self, x): | |
return self.conv(x) | |
def init_weights(self): |