Skip to content

Forward unnecessarily bloated? #1

@mueller91

Description

@mueller91

I noticed that the following code in the fordward method does not depend on input x. Is there a reason this is not run once, and only once, during model init? Seems like unneccesary overhead to run it during each fwd pass, or am i missing something?

for i in range(len(self.mel)-1):
    fmin=self.mel[i]
    fmax=self.mel[i+1]
    hHigh=(2*fmax/self.sample_rate)*np.sinc(2*fmax*self.hsupp/self.sample_rate)
    hLow=(2*fmin/self.sample_rate)*np.sinc(2*fmin*self.hsupp/self.sample_rate)
    hideal=hHigh-hLow
    
    self.band_pass[i,:]=Tensor(np.hamming(self.kernel_size))*Tensor(hideal)

band_pass_filter=self.band_pass.to(self.device)

self.filters = (band_pass_filter).view(self.out_channels, 1, self.kernel_size)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions