<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[YUNFanZ的博客]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/YUNFanZ</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; YUNFanZ]]></copyright><item><title><![CDATA[自定义层的内容]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770485</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770485</guid><author>YUNFanZ</author><pubDate>Thu, 03 Feb 2022 12:18:29 +0800</pubDate><description><![CDATA[自定义层自定义层小结
自定义层
灵活的构造学习块以适应不同的学习任务是成功的关键
不带参数的层
import tensorflow as tf


class CenteredLayer(tf.keras.Model):
    def __init__(self):
        super().__init__()

    def call(self, inputs):
        return inputs - tf.reduce_mean(inputs)

layer = CenteredL]]></description><category></category></item><item><title><![CDATA[一些卷积相关的知识]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771501</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771501</guid><author>YUNFanZ</author><pubDate>Thu, 03 Feb 2022 12:17:50 +0800</pubDate><description><![CDATA[互相关运算
def corr2d(X, K):  #@save
    """计算二维互相关运算"""
    h, w = K.shape
    Y = tf.Variable(tf.zeros((X.shape[0] - h + 1, X.shape[1] - w + 1)))
    for i in range(Y.shape[0]):
        for j in range(Y.shape[1]):
            Y[i, j].assign(tf.reduce_sum(
  .]]></description><category></category></item><item><title><![CDATA[从全连接层到卷积]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771444</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771444</guid><author>YUNFanZ</author><pubDate>Thu, 03 Feb 2022 12:17:12 +0800</pubDate><description><![CDATA[文章目录从全连接层到卷积计算机视觉的神经网络架构小结
从全连接层到卷积

多层感知机十分适合处理表格数据，其中行对应样本，列对应特征，然而对于高维感知数据，这种缺少结构的网络可能会变得不实用。
如今人类和机器都能很好地区分猫和狗：这是因为图像中本就拥有丰富的结构，而这些结构可以被人类和机器学习模型使用。 卷积神经网络（convolutional neural networks，CNN）是机器学习利用自然图像中一些已知结构的创造性方法。

计算机视觉的神经网络架构

平移不变性（translation inv]]></description><category></category></item><item><title><![CDATA[读写文件(tensorflow)]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770659</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770659</guid><author>YUNFanZ</author><pubDate>Thu, 03 Feb 2022 12:16:46 +0800</pubDate><description><![CDATA[文章目录读写文件(tensorflow)代码整理小结
读写文件(tensorflow)
代码整理
加载和保存张量
import numpy as np
import tensorflow as tf

x = tf.range(4)
np.save('x-file.npy', x)

我们现在可以将存储在文件中的数据读回内存
x2 = np.load('x-file.npy', allow_pickle=True)

我们可以存储一个张量列表，然后把它们读回内存
y = tf.zeros(4)
np.sav]]></description><category></category></item><item><title><![CDATA[GPU的使用说明]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771254</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122771254</guid><author>YUNFanZ</author><pubDate>Thu, 03 Feb 2022 12:16:13 +0800</pubDate><description><![CDATA[文章目录GPU的使用说明小结
GPU的使用说明
查看显卡信息
!nvidia-smi

计算设备
import tensorflow as tf

tf.device('/CPU:0'), tf.device('/GPU:0'), tf.device('/GPU:1')

查询GPU数量
len(tf.config.experimental.list_physical_devices('GPU'))

张量与GPU
我们可以查询张量所在的设备。 默认情况下，张量是在CPU上创建的。
x = tf.const]]></description><category></category></item><item><title><![CDATA[延后初始化]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770373</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122770373</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 16:43:33 +0800</pubDate><description><![CDATA[延后初始化简述小结
简述
到目前为止，我们忽略了建立网络时需要做的以下这些事情：

我们定义了网络架构，但没有指定输入维度。
我们添加层时没有指定前一层的输出维度。
我们在初始化参数时，甚至没有足够的信息来确定模型应该包含多少参数。

你可能会对我们的代码能运行感到惊讶。 毕竟，深度学习框架无法判断网络的输入维度是什么。 这里的诀窍是框架的延后初始化（defers initialization）， 即直到数据第一次通过模型传递时，框架才会动态地推断出每个层的大小。
实例化网络
import tensorfl]]></description><category></category></item><item><title><![CDATA[tensorflow参数访问]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769966</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769966</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 16:19:45 +0800</pubDate><description><![CDATA[参数管理tensorflow 版参数初始化小结
tensorflow 版
我们首先看一下具有单隐藏层的多层感知机
import tensorflow as tf

net = tf.keras.models.Sequential([
    tf.keras.layers.Flatten(),
    tf.keras.layers.Dense(4, activation=tf.nn.relu),
    tf.keras.layers.Dense(1),
])

X = tf.random.uniform]]></description><category></category></item><item><title><![CDATA[model - construction]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769851</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769851</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 15:45:19 +0800</pubDate><description><![CDATA[层和块model - construction小结
model - construction
我们先回顾一下多层感知机
import tensorflow as tf

net = tf.keras.models.Sequential([
    tf.keras.layers.Dense(256, activation=tf.nn.relu),
    tf.keras.layers.Dense(10),
])

X = tf.random.uniform((2, 20))
net(X)

自定义块
cl]]></description><category></category></item><item><title><![CDATA[softmax简洁实现]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769698</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769698</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 15:24:24 +0800</pubDate><description><![CDATA[softmax简洁实现代码部分小结
代码部分
import tensorflow as tf
from d2l import tensorflow as d2l

batch_size = 256

train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size)`

net = tf.keras.models.Sequential()

net.add(tf.keras.layers.Flatten(input_shape=(28, 28)))]]></description><category></category></item><item><title><![CDATA[softmax 回归实现]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769450</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769450</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 15:07:14 +0800</pubDate><description><![CDATA[softmax 回归实现代码部分小结
代码部分
引入Fashion-MNIST数据集
import tensorflow as tf
from IPython import display
from d2l import tensorflow as d2l

设置数据批量大小
batch_size = 256
train_iter, test_iter = d2l.load_data_fashion_mnist(batch_size)

初始化模型参数
num_inputs = 784
num_output]]></description><category></category></item><item><title><![CDATA[简洁的线性回归实现]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769351</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769351</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 14:28:44 +0800</pubDate><description><![CDATA[简洁的线性回归实现代码部分小结
代码部分
import numpy as np
import tensorflow as tf
from d2l import tensorflow as d2l

生成数据集
true_w = tf.constant([2, -3.4])
true_b = 4.2
features, labels = d2l.synthetic_data(true_w, true_b, 1000)

读取数据集（调用框架中现有的API来读取数据）
def load_array(data_a]]></description><category></category></item><item><title><![CDATA[从零开始线性回归]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769078</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122769078</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 14:12:29 +0800</pubDate><description><![CDATA[从零开始线性回归一. 线性回归小结
一. 线性回归
%matplotlib inline
import random
import tensorflow as tf
from d2l import tensorflow as d2l
######################
#生成数据集
def synthetic_data(w, b, num_examples):  #@save
    """生成y=Xw+b+噪声"""
    X = tf.zeros((num_examples, w.shape]]></description><category></category></item><item><title><![CDATA[图像分类数据集的读取]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122768618</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122768618</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 13:27:07 +0800</pubDate><description><![CDATA[图像分类数据集
(MNIST数据集) :cite:LeCun.Bottou.Bengio.ea.1998
(是图像分类中广泛使用的数据集之一，但作为基准数据集过于简单。
我们将使用类似但更复杂的Fashion-MNIST数据集) :cite:Xiao.Rasul.Vollgraf.2017。
#安装d2l库，（jupyter notebook）
! pip install d2l
! pip install matplotlib==2.2.3

%matplotlib inline
import tenso]]></description><category></category></item><item><title><![CDATA[softmax回归]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122768281</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122768281</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 11:30:25 +0800</pubDate><description><![CDATA[softmax 回归一.介绍分类问题网络架构softmax 运算损失函数对数似然softmax及其导数交叉熵损失信息论基础熵差异(surprisal)重新审视交叉熵模型预测和评估小结
一.介绍
分类问题

我们从一个图像分类问题开始。 假设每次输入是一个 2×2 的灰度图像。 我们可以用一个标量表示每个像素值，每个图像对应四个特征 x1,x2,x3,x4 。 此外，假设每个图像属于类别“猫”，“鸡”和“狗”中的一个。
如何表示标签:
最直接的想法是选择y∈{1,2,3}y \in \{1, 2, 3\}y∈]]></description><category></category></item><item><title><![CDATA[学习笔记ing]]></title><link>https://blog.youkuaiyun.com/YUNFanZ/article/details/122767931</link><guid>https://blog.youkuaiyun.com/YUNFanZ/article/details/122767931</guid><author>YUNFanZ</author><pubDate>Wed, 02 Feb 2022 10:45:20 +0800</pubDate><description><![CDATA[动手深度学习的学习记录]]></description><category></category></item></channel></rss>