tf.nn.embedding_lookup TensorFlow embedding_lookup 函数最简单实例

tf.nn.embedding_lookup TensorFlow embedding_lookup 函数最简单实例



#!/usr/bin/env python
# -*- coding: utf-8 -*-


import tensorflow as tf

import numpy as np

params=np.random.normal(loc=0.0,scale=1.0,size=[10,10])

ids=[1,2,3]

with tf.Session() as sess:
	print(sess.run(tf.nn.embedding_lookup(params,ids)))


http://www.tensorflownews.com/ 分享。

上一篇:中国首届原型设计大赛在成都举办


下一篇:OC 内存管理(retain和release)