本文整理匯總了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)
示例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)
示例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)