{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "Fqp93JixVuiN" }, "source": [ "##### Copyright 2018 The TensorFlow Probability Authors.\n", "\n", "Licensed under the Apache License, Version 2.0 (the \"License\");" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "cellView": "form", "id": "MeKZo1dnV1cE" }, "outputs": [], "source": [ "#@title Licensed under the Apache License, Version 2.0 (the \"License\"); { display-mode: \"form\" }\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# https://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License." ] }, { "cell_type": "markdown", "metadata": { "id": "DcriL2xPrG3_" }, "source": [ "# TensorFlow Distributions 浅析\n", "\n", "
![]() | \n",
" ![]() | \n",
" ![]() | \n",
" ![]() | \n",
"
BE
进行广播;输出中会预留“额外”维度。 "
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "iwv81UjpmlkX"
},
"source": [
"我们来探索具体含义。对于一元正态分布 `n`,`BE = ()`,因此,`log_prob` 应该为标量。如果我们向 `log_prob` 传递具有非空形状的张量,它们在输出中将显示为批次维度:"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {
"id": "xRMkZd2cnqnG"
},
"outputs": [
{
"data": {
"text/plain": [
"