tf.nn.embedding_lookup(params, ids, partition_strategy='mod', name=None, validate_indices=True, max_norm=None)

首先通过一下一个简单的例子来了解一下tf.nn.embedding_lookup()的用法

a = tf.constant([[1,2,3],[4,5,6],[7,8,9],[10,11,12]])

>>>a.eval()

Out[51]:

array([[ 1, 2, 3],

[ 4, 5, 6],

[ 7, 8, 9],

[10, 11, 12]], dtype=int32)

 
 

tf.nn.embedding_lookup(a,[0,1]).eval()

>>>Out[52]:

array([[1, 2, 3],

[4, 5, 6]], dtype=int32)

 
 

tf.nn.embedding_lookup(a,[[0,1],[1,2]]).eval()

>>>Out[53]:

array([[[1, 2, 3],

[4, 5, 6]],

[[4, 5, 6],

[7, 8, 9]]], dtype=int32)

最新文章

  1. windows server 2008禁止ping
  2. 跟vczh看实例学编译原理——一:Tinymoe的设计哲学
  3. Shell高级编程视频教程-跟着老男孩一步步学习Shell高级编程实战视频教程
  4. mysql数据库---同时插入两个表以上的数据
  5. Java系列:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
  6. 安装qmake与环境变量解析
  7. [Linux]Nginx + Node.js + PM2 + MongoDb + (Memcached) Part I
  8. 110个oracle常用函数总结
  9. 新导入的eclipse项目报错,找不到java包,找不到web.xml文件报错。
  10. docker基本使用
  11. 1.7Oob封装 继承 访问修饰符 静态和构造方法的执行顺序
  12. 关于SqlServer数据表操作
  13. EnglishGame
  14. 修改IP地址的PowerShell
  15. LED驱动程序分析
  16. Python入门与基本概念
  17. spring boot 在jdk 1.7下使用 commandLineRunner
  18. Leetcode 之Evaluate Reverse Polish Notation(41)
  19. node.js+express+jade系列二:rotue路由的配置
  20. spring扩展点之四:Spring Aware容器感知技术,BeanNameAware和BeanFactoryAware接口,springboot中的EnvironmentAware

热门文章

  1. 【Cf #292 D】Drazil and Morning Exercise(树的直径,树上差分)
  2. 洛谷 P4244 [SHOI2008]仙人掌图 II 解题报告
  3. Centos7搭建redis集群及安装sentinel
  4. Gradle 命令之 --stacktrace , --info , --debug 用法
  5. SpringCloud微服务实战-Zuul-APIGateway(十)
  6. Kubernetes Deloyment实现滚动更新
  7. ROI POOLING 介绍
  8. in的对象选择(子查询还是List集合),in 的优化,in与exists
  9. getContentLength() 指为 -1 的解决办法
  10. python---web微信开发