forked from mrq/DL-Art-School
channel clipper
This commit is contained in:
parent
47330d603b
commit
7ff1fbe2be
|
@ -368,5 +368,16 @@ class NormalizeMelInjector(Injector):
|
||||||
return {self.output: normalize_mel(mel)}
|
return {self.output: normalize_mel(mel)}
|
||||||
|
|
||||||
|
|
||||||
|
class ChannelClipInjector(Injector):
|
||||||
|
def __init__(self, opt, env):
|
||||||
|
super().__init__(opt, env)
|
||||||
|
self.lo = opt['channel_low']
|
||||||
|
self.hi = opt['channel_high']
|
||||||
|
|
||||||
|
def forward(self, state):
|
||||||
|
inp = state[self.input]
|
||||||
|
return {self.output: inp[:,self.lo:self.hi]}
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print('hi')
|
print('hi')
|
Loading…
Reference in New Issue
Block a user