def weights(x, kimax=None, kjmax=None, cross=True): """Returns optimal weight and weight prime.""" _bg1 = bg1(kimax, kjmax) _bg2 = bg2(kimax, kjmax) delta = 0. _g1 = g1(x, kimax, kjmax, cross) w = weight_from_g(_g1, delta) wp = weight_prime_from_g(_g1, delta, _bg1, _bg2) return w, wp
window[...] = 1. #: we must create a video of windows for multiplication window_video = ((window, window), ) * NFRAMES #: determines optimal weight factor from examples.paper.form_factor import g1, bg1, bg2 from cddm.norm import weight_from_g, weight_prime_from_g bg1 = bg1(KIMAX, 0) bg2 = bg2(KIMAX, 0) delta = 0. g1 = g1(np.arange(NFRAMES), KIMAX, 0) w = weight_from_g(g1, delta) wp = weight_prime_from_g(g1, delta, bg1, bg2) def calculate(): out = None bgs = [] vars = [] for i in range(NRUN): print("Run {}/{}".format(i + 1, NRUN)) seed(i) importlib.reload(video_simulator) #recreates iterator with new seed