コード例 #1
0
    def __init__(self, **kwargs):
        Net.__init__(self, **kwargs)
        c = self.c

        sg_n_out = c.n_object * c.symbol_size * 3
        n_in = c.n_in * c.n_object
        self._sg_net = MLP(n_in + sg_n_out, sg_n_out, c.hidden_dims)
コード例 #2
0
ファイル: rpn_pb.py プロジェクト: zhuyifengzju/RPN
    def __init__(self, **kwargs):
        Net.__init__(self, **kwargs)
        c = self.c
        n_entities = c.n_object * (c.n_object + 1)
        input_size = c.im_enc_size * c.n_object
        symbol_size = c.symbol_size * n_entities * 3

        self._state_encoder = ImageEncoder(IMAGE_SIZE, c.im_enc_size)
        self._subgoal = MLP(input_size + symbol_size, symbol_size,
                            c.hidden_dims)
コード例 #3
0
 def __init__(self, **kwargs):
     Net.__init__(self, **kwargs)
     c = self.c
     input_size = c.n_in * c.n_object
     symbol_size = c.symbol_size * c.n_object * 3
     self._subgoal = MLP(input_size + symbol_size, symbol_size,
                         c.hidden_dims)
     self._satisfied = MLP(c.n_in + c.symbol_size * 2, 2, c.hidden_dims)
     self._dependency = MLP(c.n_in * 2 + c.symbol_size * 4, 2,
                            c.hidden_dims)
コード例 #4
0
 def __init__(self, **kwargs):
     Net.__init__(self, **kwargs)
     c = self.c
     input_size = c.n_in * c.n_object
     symbol_size = c.symbol_size * c.n_object * 3
     self._focus = MLP(input_size + symbol_size, symbol_size, c.hidden_dims)
     self._preimage = MLP(input_size + symbol_size, symbol_size,
                          c.hidden_dims)
     self._reachable_encoder = MLP(c.n_in + c.symbol_size * 3,
                                   64,
                                   layer_dims=(128, ),
                                   output_activation=nn.ReLU)
     self._reachable = MLP(64, 2, [64])
コード例 #5
0
    def __init__(self, **kwargs):
        Net.__init__(self, **kwargs)
        c = self.c
        input_size = c.n_in * c.n_object
        symbol_size = c.symbol_size * c.n_object * 3

        # self._policy = MLP(input_size + symbol_size, c.n_action, c.policy_dims)
        self._preimage = MLP(input_size + symbol_size, symbol_size,
                             c.hidden_dims)
        self._reachable = MLP(input_size + symbol_size, 2, c.hidden_dims)
        self._satisfied = MLP(c.n_in + c.symbol_size * 2, 2, c.hidden_dims)
        self._dependency = MLP(c.n_in * 2 + c.symbol_size * 4, 2,
                               c.hidden_dims)
コード例 #6
0
ファイル: rpn_pb.py プロジェクト: zhuyifengzju/RPN
    def __init__(self, **kwargs):
        Net.__init__(self, **kwargs)
        c = self.c
        n_entities = c.n_object * (c.n_object + 1)
        input_size = c.im_enc_size * c.n_object
        symbol_size = c.symbol_size * n_entities * 3

        self._state_encoder = ImageEncoder(IMAGE_SIZE, c.im_enc_size)

        self._focus = MLP(input_size + symbol_size, symbol_size, c.hidden_dims)
        self._preimage = MLP(input_size + symbol_size, symbol_size,
                             c.hidden_dims)
        self._reachable = ReachableNet(c.im_enc_size, c.symbol_size)

        src, tgt = torch.meshgrid(torch.arange(c.n_object),
                                  torch.arange(c.n_object))
        self.register_buffer('edge_src', src.contiguous().view(-1))
        self.register_buffer('edge_tgt', tgt.contiguous().view(-1))
        self._object_feat_pad = nn.ConstantPad1d((0, c.im_enc_size), 0)