当前位置: 首页>>代码示例>>Python>>正文


Python tensorflow.padded_reshape方法代码示例

本文整理汇总了Python中my.tensorflow.padded_reshape方法的典型用法代码示例。如果您正苦于以下问题:Python tensorflow.padded_reshape方法的具体用法?Python tensorflow.padded_reshape怎么用?Python tensorflow.padded_reshape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在my.tensorflow的用法示例。


在下文中一共展示了tensorflow.padded_reshape方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from my import tensorflow [as 别名]
# 或者: from my.tensorflow import padded_reshape [as 别名]
def __init__(self, config, models, tensor_dict=None):
        super(MultiGPUF1Evaluator, self).__init__(config, models[0], tensor_dict=tensor_dict)
        self.models = models
        with tf.name_scope("eval_concat"):
            N, M, JX = config.batch_size, config.max_num_sents, config.max_sent_size
            self.yp = tf.concat(axis=0, values=[padded_reshape(model.yp, [N, M, JX]) for model in models])
            self.yp2 = tf.concat(axis=0, values=[padded_reshape(model.yp2, [N, M, JX]) for model in models])
            self.loss = tf.add_n([model.loss for model in models])/len(models) 
开发者ID:IsaacChanghau,项目名称:AmusingPythonCodes,代码行数:10,代码来源:evaluator.py

示例2: __init__

# 需要导入模块: from my import tensorflow [as 别名]
# 或者: from my.tensorflow import padded_reshape [as 别名]
def __init__(self, config, models, tensor_dict=None):
        super(MultiGPUF1Evaluator, self).__init__(config, models[0], tensor_dict=tensor_dict)
        self.models = models
        with tf.name_scope("eval_concat"):
            N, M, JX = config.batch_size, config.max_num_sents, config.max_sent_size
            self.yp = tf.concat(axis=0, values=[padded_reshape(model.yp, [N, M, JX]) for model in models])
            self.yp2 = tf.concat(axis=0, values=[padded_reshape(model.yp2, [N, M, JX]) for model in models])
            self.wy = tf.concat(axis=0, values=[padded_reshape(model.wy, [N, M, JX]) for model in models])
            self.loss = tf.add_n([model.loss for model in models])/len(models) 
开发者ID:IsaacChanghau,项目名称:AmusingPythonCodes,代码行数:11,代码来源:evaluator.py

示例3: __init__

# 需要导入模块: from my import tensorflow [as 别名]
# 或者: from my.tensorflow import padded_reshape [as 别名]
def __init__(self, config, models, tensor_dict=None):
        super(MultiGPUF1Evaluator, self).__init__(config, models[0], tensor_dict=tensor_dict)
        self.models = models
        with tf.name_scope("eval_concat"):
            N, M, JX = config.batch_size, config.max_num_sents, config.max_sent_size
            self.yp = tf.concat(0, [padded_reshape(model.yp, [N, M, JX]) for model in models])
            self.yp2 = tf.concat(0, [padded_reshape(model.yp2, [N, M, JX]) for model in models])
            self.loss = tf.add_n([model.loss for model in models])/len(models) 
开发者ID:sld,项目名称:convai-bot-1337,代码行数:10,代码来源:evaluator.py


注:本文中的my.tensorflow.padded_reshape方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。