我一直在TensorFlow中使用矩阵乘法的介绍性示例.
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
Run Code Online (Sandbox Code Playgroud)
当我打印产品时,它将其显示为Tensor对象:
<tensorflow.python.framework.ops.Tensor object at 0x10470fcd0>
Run Code Online (Sandbox Code Playgroud)
但我怎么知道它的价值product?
以下内容没有帮助:
print product
Tensor("MatMul:0", shape=TensorShape([Dimension(1), Dimension(1)]), dtype=float32)
Run Code Online (Sandbox Code Playgroud)
我知道图表会运行Sessions,但是没有任何方法可以在Tensor不运行图形的情况下检查对象的输出session?
我尝试安装Ray,但出现错误:
TypeError: Descriptors cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
1. Downgrade the protobuf package to 3.20.x or lower.
2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
Run Code Online (Sandbox Code Playgroud)
我尝试解决问题并降级protobuf:
Name: protobuf
Version: 3.20.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/ …Run Code Online (Sandbox Code Playgroud) 标题说明了一切.我正在使用Ubuntu 16.04长期支持.
TensorFlow有两种方法来评估图的一部分:Session.run在变量列表和Tensor.eval.这两者有区别吗?
在下面的TensorFlow函数中,我们必须在最后一层中提供人工神经元的激活.我明白了 但我不明白为什么它被称为logits?这不是一个数学函数吗?
loss_function = tf.nn.softmax_cross_entropy_with_logits(
logits = last_layer,
labels = target_output
)
Run Code Online (Sandbox Code Playgroud) machine-learning neural-network deep-learning tensorflow cross-entropy
我真的很想在C++中开始使用谷歌新的Tensorflow库.关于如何构建项目的C++ API,网站和文档真的不清楚,我不知道从哪里开始.
通过发现和分享使用tensorflow的C++ API的指南,有经验帮助的人可以提供帮助吗?
tf.nn.embedding_lookup(params, ids, partition_strategy='mod', name=None)
Run Code Online (Sandbox Code Playgroud)
我无法理解这个功能的职责.它是否像查找表?这意味着返回与每个id(在id中)对应的参数?
例如,skip-gram如果我们使用模型tf.nn.embedding_lookup(embeddings, train_inputs),那么每个模型都会train_input找到相应的嵌入?
python deep-learning tensorflow word-embedding natural-language-processing
在使用带有Python绑定的Tensorflow时,如何将张量转换为numpy数组?
如何tf.app.run()在Tensorflow中翻译演示?
在tensorflow/models/rnn/translate/translate.py,有一个电话tf.app.run().怎么处理?
if __name__ == "__main__":
tf.app.run()
Run Code Online (Sandbox Code Playgroud) 我最近开始研究深度学习和其他ML技术,我开始寻找简化构建网络和训练它的过程的框架,然后我发现TensorFlow,在该领域经验不多,对我来说,似乎速度是一个如果使用深度学习,那么制作大型ML系统的重要因素就更多了,那么为什么谷歌选择python制作TensorFlow?用一种可以编译而不是解释的语言来表达它会不会更好?
使用Python而不是像C++这样的语言进行机器学习有什么好处?
tensorflow ×10
python ×8
c++ ×2
command-line ×1
natural-language-processing ×1
numpy ×1
python-3.x ×1
ray ×1
tensor ×1
ubuntu ×1
version ×1