當前位置: 首頁>>代碼示例>>Python>>正文


Python models.MLP屬性代碼示例

本文整理匯總了Python中models.MLP屬性的典型用法代碼示例。如果您正苦於以下問題:Python models.MLP屬性的具體用法?Python models.MLP怎麽用?Python models.MLP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在models的用法示例。


在下文中一共展示了models.MLP屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import models [as 別名]
# 或者: from models import MLP [as 別名]
def __init__(self, state_vocab, object_vocab, args, map_dim = 10, batch_size = 32):
        super(UVFA_pos, self).__init__()
        
        self.state_vocab = state_vocab
        self.object_vocab = object_vocab
        self.total_vocab = state_vocab + object_vocab
        self.pos_size = 2

        self.rank = args.rank
        self.map_dim = map_dim
        self.batch_size = batch_size
        self.positions = self.__agent_pos()

        ## add one for agent position
        self.input_dim = (self.total_vocab + 1) * (map_dim**2)
        self.world_layers = [self.input_dim, 128, 128, args.rank]
        self.world_mlp = models.MLP(self.world_layers)

        # self.object_dim = self.object_vocab * (map_dim**2)
        self.pos_layers = [self.pos_size, 128, 128, args.rank]
        self.pos_mlp = models.MLP(self.pos_layers) 
開發者ID:JannerM,項目名稱:spatial-reasoning,代碼行數:23,代碼來源:uvfa_pos.py

示例2: __init__

# 需要導入模塊: import models [as 別名]
# 或者: from models import MLP [as 別名]
def __init__(self, lstm, state_vocab, object_vocab, args, map_dim = 10, batch_size = 32):
        super(UVFA_text, self).__init__()
        
        self.state_vocab = state_vocab
        self.object_vocab = object_vocab
        self.lstm = lstm
        self.rank = args.rank
        self.map_dim = map_dim
        self.batch_size = batch_size
        self.positions = self.__agent_pos()

        ## add one for agent position
        self.state_dim = (self.state_vocab+1) * (map_dim**2)
        # self.state_dim = self.state_vocab * map_dim**2
        self.state_layers = [self.state_dim, 128, 128, args.rank]
        self.state_mlp = models.MLP(self.state_layers)

        self.object_dim = self.object_vocab * (map_dim**2)
        self.object_layers = [self.object_dim, 128, 128, args.rank]
        self.object_mlp = models.MLP(self.object_layers) 
開發者ID:JannerM,項目名稱:spatial-reasoning,代碼行數:22,代碼來源:uvfa_text.py

示例3: main

# 需要導入模塊: import models [as 別名]
# 或者: from models import MLP [as 別名]
def main(args):
    # Context
    ctx = get_extension_context("cudnn", device_id=args.device_id)
    nn.set_default_context(ctx)

    # Network
    nn.load_parameters(args.model_load_path)
    model = MLP(args.dims, args.ldims, test=True)

    # Compute points and values
    pts, vol = utils.compute_pts_vol(model, args.grid_size, args.volume_factor,
                                     args.sub_batch_size)
    mesh = utils.create_mesh_from_volume(vol, args.gradient_direction)

    # Save as mesh
    dirname, pname = args.model_load_path.split("/")
    fname = os.path.splitext(pname)[0]
    fpath = "{}/{}_mesh.ply".format(dirname, fname)
    logger.info("Saving the mesh file to {}".format(fpath))
    utils.write_mesh(fpath, mesh) 
開發者ID:sony,項目名稱:nnabla-examples,代碼行數:22,代碼來源:infer.py


注:本文中的models.MLP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。