MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / create_window

Function create_window

modules/commons/ssim.py:324–328  ·  view source on GitHub ↗
(window_size, channel)

Source from the content-addressed store, hash-verified

322
323
324def create_window(window_size, channel):
325 _1D_window = gaussian(window_size, 1.5).unsqueeze(1)
326 _2D_window = _1D_window.mm(_1D_window.t()).float().unsqueeze(0).unsqueeze(0)
327 window = Variable(_2D_window.expand(channel, 1, window_size, window_size).contiguous())
328 return window
329
330
331def _ssim(img1, img2, window, window_size, channel, size_average=True):

Callers 3

__init__Method · 0.85
forwardMethod · 0.85
ssimFunction · 0.85

Calls 1

gaussianFunction · 0.85

Tested by

no test coverage detected