当前位置: 首页>>代码示例>>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;未经允许,请勿转载。