tf.nn.embedding_lookup函数
2024-08-21 17:24:05
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)
最新文章
- windows server 2008禁止ping
- 跟vczh看实例学编译原理——一:Tinymoe的设计哲学
- Shell高级编程视频教程-跟着老男孩一步步学习Shell高级编程实战视频教程
- mysql数据库---同时插入两个表以上的数据
- Java系列:报错信息The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- 安装qmake与环境变量解析
- [Linux]Nginx + Node.js + PM2 + MongoDb + (Memcached) Part I
- 110个oracle常用函数总结
- 新导入的eclipse项目报错,找不到java包,找不到web.xml文件报错。
- docker基本使用
- 1.7Oob封装 继承 访问修饰符 静态和构造方法的执行顺序
- 关于SqlServer数据表操作
- EnglishGame
- 修改IP地址的PowerShell
- LED驱动程序分析
- Python入门与基本概念
- spring boot 在jdk 1.7下使用 commandLineRunner
- Leetcode 之Evaluate Reverse Polish Notation(41)
- node.js+express+jade系列二:rotue路由的配置
- spring扩展点之四:Spring Aware容器感知技术,BeanNameAware和BeanFactoryAware接口,springboot中的EnvironmentAware
热门文章
- 【Cf #292 D】Drazil and Morning Exercise(树的直径,树上差分)
- 洛谷 P4244 [SHOI2008]仙人掌图 II 解题报告
- Centos7搭建redis集群及安装sentinel
- Gradle 命令之 --stacktrace , --info , --debug 用法
- SpringCloud微服务实战-Zuul-APIGateway(十)
- Kubernetes Deloyment实现滚动更新
- ROI POOLING 介绍
- in的对象选择(子查询还是List集合),in 的优化,in与exists
- getContentLength() 指为 -1 的解决办法
- python---web微信开发