a277fd89980f7a4647d0a17548aba7df37a5aefb,pyprob/nn/inference_network_feedforward.py,InferenceNetworkFeedForward,_embed_observe,#InferenceNetworkFeedForward#Any#,154

Before Change


        super().to(device=device, *args, *kwargs)

    def _embed_observe(self, observe=None):
        if observe is None:
            raise ValueError("All observes in observe_embeddings are needed to initialize a new trace.")
        return self._layer_observe_embedding_final(torch.cat([layer.forward(observe[name]).view(-1) for name, layer in self._layer_observe_embedding.items()]))

    def infer_trace_init(self, observe=None):
        self._infer_observe = observe

After Change


        super().to(device=device, *args, *kwargs)

    def _embed_observe(self, traces=None):
        embedding = []
        for name, layer in self._layer_observe_embedding.items():
            values = torch.stack([trace.named_variables[name].value for trace in traces]).view(len(traces), -1)
            embedding.append(layer(values))
        embedding = torch.cat(embedding, dim=1)
        embedding = self._layer_observe_embedding_final(embedding)
        return embedding

    def infer_trace_init(self, observe=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: pyprob/pyprob
Commit Name: a277fd89980f7a4647d0a17548aba7df37a5aefb
Time: 2018-09-19
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/inference_network_feedforward.py
Class Name: InferenceNetworkFeedForward
Method Name: _embed_observe


Project Name: masa-su/pixyz
Commit Name: 30028c6256de0cef715095e3994e396025c068d4
Time: 2020-05-04
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/distributions/flow_distribution.py
Class Name: InverseTransformedDistribution
Method Name: sample


Project Name: masa-su/pixyz
Commit Name: 57830b8c78a8f0997f9a7dc61d33a1bf1adb3ca5
Time: 2021-01-25
Author: kaneko@weblab.t.u-tokyo.ac.jp
File Name: pixyz/distributions/flow_distribution.py
Class Name: InverseTransformedDistribution
Method Name: sample


Project Name: pyprob/pyprob
Commit Name: a277fd89980f7a4647d0a17548aba7df37a5aefb
Time: 2018-09-19
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/nn/inference_network_feedforward.py
Class Name: InferenceNetworkFeedForward
Method Name: _embed_observe