tensorflow函数测试之tf.tile

博客介绍了对张量自身进行不同阶复制的功能,还说明了其参数情况。要处理的张量可以是任意阶,有一个一阶int型张量说明复制方向,其维度等于输入张量阶数,各维度值为复制次数。

主要功能是对张量自身进行不同阶上的复制

其参数如下:

tile(
    input,
    multiples,
    name=None
)

其中

  1. input:要处理的张量,可以是任意阶的
  2. 说明在哪个方向上进行复制,一阶int型张量,维度等于input的阶数,每一维度上的值是要复制的次数

import tensorflow as tf

raw = tf.constant([[[1,2,3],[4,5,6]],[[6,7,8],[8,9,10]]])
multi = tf.tile(raw, multiples=[2, 3,2])

with tf.Session() as sess:
    print(raw.eval())
    print('-----------------------------')
    print(sess.run(multi))

 

Learning low-dimensional embeddings of knowledge graphs is a powerful approach used to predict unobserved or missing edges between entities. However, an open challenge in this area is developing techniques that can go beyond simple edge prediction and handle more complex logical queries, which might involve multiple unobserved edges, entities, and variables. For instance, given an incomplete biological knowledge graph, we might want to predict what drugs are likely to target proteins involved with both diseases X and Y?—a query that requires reasoning about all possible proteins that might interact with diseases X and Y. Here we introduce a framework to efficiently make predictions about conjunctive logical queries—a flexible but tractable subset of first-order logic—on incomplete knowledge graphs. In our approach, we embed graph nodes in a low-dimensional space and represent logical operators as learned geometric operations (e.g., translation, rotation) in this embedding space. By performing logical operations within a low-dimensional embedding space, our approach achieves a time complexity that is linear in the number of query variables, compared to the exponential complexity required by a naive enumeration-based approach. We demonstrate the utility of this framework in two application studies on real-world datasets with millions of relations: predicting logical relationships in a network of drug-gene-disease interactions and in a graph-based representation of social interactions derived from a popular web forum.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值