Exemple #1
0
 def _plan_PresentInput(self, ops):
     ps = [op.process for op in ops]
     Y = self.all_data[[self.sidx[op.output] for op in ops]]
     t = self.all_data[[self.sidx[self._step] for _ in ops]]
     inputs = self.RaggedArray([p.inputs.reshape(p.inputs.shape[0], -1)
                                for p in ps], dtype=np.float32)
     pres_t = self.Array([p.presentation_time for p in ps])
     dt = self.model.dt
     return [plan_presentinput(self.queue, Y, t, inputs, dt, pres_t=pres_t)]
Exemple #2
0
 def _plan_PresentInput(self, ops):
     ps = [op.process for op in ops]
     Y = self.all_data[[self.sidx[op.output] for op in ops]]
     t = self.all_data[[self.sidx[self.model.step] for _ in ops]]
     inputs = self.RaggedArray(
         [p.inputs.reshape(p.inputs.shape[0], -1) for p in ps],
         dtype=np.float32)
     pres_t = self.Array([p.presentation_time for p in ps])
     dt = self.model.dt
     return [plan_presentinput(self.queue, Y, t, inputs, dt, pres_t=pres_t)]
Exemple #3
0
    def _plan_WhiteSignal(self, ops):
        Y = self.all_data[[self.sidx[op.output] for op in ops]]
        t = self.all_data[[self.sidx[self._step] for _ in ops]]

        dt = self.model.dt
        signals = []
        for op in ops:
            assert op.input is None and op.output is not None
            f = op.process.make_step(0, op.output.size, dt, self.rng)
            signals.append(get_closures(f)['signal'])

        signals = self.RaggedArray(signals, dtype=np.float32)
        return [plan_presentinput(self.queue, Y, t, signals, dt)]
Exemple #4
0
    def _plan_WhiteSignal(self, ops):
        Y = self.all_data[[self.sidx[op.output] for op in ops]]
        t = self.all_data[[self.sidx[self._step] for _ in ops]]

        dt = self.model.dt
        signals = []
        for op in ops:
            assert op.input is None and op.output is not None
            f = op.process.make_step(0, op.output.size, dt, self.rng)
            signals.append(get_closures(f)['signal'])

        signals = self.RaggedArray(signals, dtype=np.float32)
        return [plan_presentinput(self.queue, Y, t, signals, dt)]