<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[apodx的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/apodx</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; apodx]]></copyright><item><title><![CDATA[轻量化网络——ghostnet代码讲解]]></title><link>https://blog.csdn.net/apodx/article/details/124778921</link><guid>https://blog.csdn.net/apodx/article/details/124778921</guid><author>apodx</author><pubDate>Sun, 15 May 2022 14:21:58 +0800</pubDate><description><![CDATA[背景

神经网络在移动设备上的应用还亟待解决，主要原因是现有模型又大又慢。因而，一些研究提出了模型的压缩方法，比如剪枝、量化、知识蒸馏等；还有一些则着重于高效的网络结构设计，比如MobileNet，ShuffleNet等。本文就设计了一种全新的神经网络基本单元Ghost模块，从而搭建出轻量级神经网络架构GhostNet。
在一个训练好的深度神经网络中，通常会包含丰富甚至冗余的特征图，以保证对输入数据有全面的理解。如下图所示，在ResNet-50中，将经过第一个残差块处理后的特征图拿出来，三个相似的特征图对示]]></description><category></category></item><item><title><![CDATA[matplotlib读取ndarry格式图片并进行不失真的resize]]></title><link>https://blog.csdn.net/apodx/article/details/124766516</link><guid>https://blog.csdn.net/apodx/article/details/124766516</guid><author>apodx</author><pubDate>Sat, 14 May 2022 12:26:08 +0800</pubDate><description><![CDATA[1.


import cv2
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from matplotlib.image import imread
def letterbox_image(image, size):
    ih, iw, _   = np.shape(image)
    w, h        = size
    scale       = min(w/iw, h/ih)
    nw]]></description><category></category></item><item><title><![CDATA[指数加权平均(MEA)]]></title><link>https://blog.csdn.net/apodx/article/details/124646664</link><guid>https://blog.csdn.net/apodx/article/details/124646664</guid><author>apodx</author><pubDate>Sun, 08 May 2022 13:38:20 +0800</pubDate><description><![CDATA[1. 定义

滑动平均(exponential moving average)，或者叫做指数加权平均(exponentially weighted moving average)，可以用来估计变量的局部均值，使得变量的更新与一段时间内的历史取值有关。

2. 通俗解释

变量 在 𝑡 时刻记，为变量𝑣在𝑡时刻的取值，即在不使用滑动平均模型时 ，在使用滑动平均模型后，的更新公式如下：



上式中，𝛽∈[0,1)β∈[0,1)。若β=0 相当于没有使用滑动平均。

3. 代码实现


class E...]]></description><category></category></item><item><title><![CDATA[docker笔记三——Dockerfile相关命令]]></title><link>https://blog.csdn.net/apodx/article/details/124584574</link><guid>https://blog.csdn.net/apodx/article/details/124584574</guid><author>apodx</author><pubDate>Thu, 05 May 2022 11:10:44 +0800</pubDate><description><![CDATA[我们先看一个Dockerfile的Demo
参考的代码
FROM python:3.7
COPY . /app 
WORKDIR /app
RUN ["pip3", "install", "-r", "requirements.txt"]
EXPOSE 3000
CMD ["python3", "server.py"]


Dockerfile使用基本的基于DSL语法的指令来构建一个Docker镜像，之后使用docker
builder命令基于该Dockerfile中的指令构建一个新的镜像
1）DSL 语法]]></description><category></category></item><item><title><![CDATA[docker笔记二——容器（Container）相关命令]]></title><link>https://blog.csdn.net/apodx/article/details/124584479</link><guid>https://blog.csdn.net/apodx/article/details/124584479</guid><author>apodx</author><pubDate>Thu, 05 May 2022 10:57:16 +0800</pubDate><description><![CDATA[二、容器操作

创建容器

docker run [option] --name=${name} image command [args...]

option 选项：
-i： 交互式容器
-t：tty，终端
-d：后台运行，并且打印出容器id
示例：
docker run -i -t -d --name=centOS1 centos /bin/bash

或者
docker run -itd --name=centOS1 centos /bin/bash

注： 创建的容器名称不能重复

进入容器


方]]></description><category></category></item><item><title><![CDATA[docker学习笔记一 ——镜像（image）相关命令]]></title><link>https://blog.csdn.net/apodx/article/details/124584444</link><guid>https://blog.csdn.net/apodx/article/details/124584444</guid><author>apodx</author><pubDate>Thu, 05 May 2022 10:54:27 +0800</pubDate><description><![CDATA[列出镜像

docker images


REPOSITORY：表示镜像的仓库源
TAG：镜像的标签
IMAGE ID：镜像ID
CREATED：镜像创建时间
SIZE：镜像大小


查找镜像

docker search ${image_name}


NAME：镜像仓库源的名称
DESCRIPTION：镜像的描述
starts：用户评价，反应一个镜像的受欢迎程度
OFFICIAL：是否docker官方发布
auto commit：自动构建，表示该镜像由 Docker Hub 自动构建流程创建的


.]]></description><category></category></item><item><title><![CDATA[Python 中 next filter map lambda的一点使用小技巧]]></title><link>https://blog.csdn.net/apodx/article/details/124282362</link><guid>https://blog.csdn.net/apodx/article/details/124282362</guid><author>apodx</author><pubDate>Tue, 19 Apr 2022 20:23:34 +0800</pubDate><description><![CDATA[a = [1,2,3,4,5]

la = lambda x:x+2

# map是python内置函数,会根据提供的函数对指定的序列做映射 
b = map(la,a)

list(b)

[3, 4, 5, 6, 7]

#  iter() 函数用来生成迭代器
c = iter(a)

next(c)

1

next(c)

2

next(c)

3

next(c)

4

next(c)

5

# 迭代完会报异常
next(c)

-------------------------------]]></description><category></category></item><item><title><![CDATA[python中的Iterable和Iterator对象及调用]]></title><link>https://blog.csdn.net/apodx/article/details/123941825</link><guid>https://blog.csdn.net/apodx/article/details/123941825</guid><author>apodx</author><pubDate>Sun, 03 Apr 2022 18:35:08 +0800</pubDate><description><![CDATA[for的本质是什么？
调用Iterable对象__iter__方法得到Iterator,然后不断调用__next__方法
什么是Iterable对象？
可以一次一个返回数据的Object，需要实现__iter__方法返回Iterator对象
什么是Iterator对象？
实现__iter__方法和__next__方法，（__iter__返回self即可）
Object.getitem(self,key)?
实现self[key]索引取值

class MyIterable():
    def __ini.]]></description><category></category></item><item><title><![CDATA[swin-transformer详解及代码复现]]></title><link>https://blog.csdn.net/apodx/article/details/123941720</link><guid>https://blog.csdn.net/apodx/article/details/123941720</guid><author>apodx</author><pubDate>Sun, 03 Apr 2022 18:29:58 +0800</pubDate><description><![CDATA[1. swin-transformer网络结构




实际上，我们在进行代码复现时应该是下图,接下来我们根据下面的图片进行分段实现

2. Patch Partition &amp; Patch Embedding
首先将图片输入到Patch Partition模块中进行分块，即每4x4相邻的像素为一个Patch，然后在channel方向展平（flatten）。假设输入的是RGB三通道图片，那么每个patch就有4x4=16个像素，然后每个像素有R、G、B三个值所以展平后是16x3=48，所以通过Patc]]></description><category></category></item><item><title><![CDATA[Vision Transformer代码讲解及复现]]></title><link>https://blog.csdn.net/apodx/article/details/123941610</link><guid>https://blog.csdn.net/apodx/article/details/123941610</guid><author>apodx</author><pubDate>Sun, 03 Apr 2022 18:23:50 +0800</pubDate><description><![CDATA[VIT(Vision in Transformer)网络结构

1. Embedding层结构详解
在代码实现中，直接通过一个卷积层来实现。
在输入Transformer Encoder之前注意需要加上token以及Position Embedding。

import paddle
import paddle.nn as nn
from PIL import Image
import numpy as np
class PatchEmbedding(nn.Layer):
    def __init__(]]></description><category></category></item><item><title><![CDATA[paddle GPU 终极安装教程]]></title><link>https://blog.csdn.net/apodx/article/details/123819148</link><guid>https://blog.csdn.net/apodx/article/details/123819148</guid><author>apodx</author><pubDate>Tue, 29 Mar 2022 13:54:16 +0800</pubDate><description><![CDATA[1. 首先创建一个虚拟环境，名称为paddle，我们将在该环境下安装paddle GPU版


conda create -n paddle python=3.7

2. 安装GPU版本 ，首先查看自己的显卡最高支持的CUDA版本，



3. 可以看到11.1以下的cuda 版本都是支持的，反之，11.1以上的版本我们是不能安装的。这里我们选择cuda10.2，个人觉得大多数的机器学习框架都是支持该cuda 版本的。

4. 下载cuda版本10.2，下载完成后一步步的安装即可。CUDA下载地址



5]]></description><category></category></item><item><title><![CDATA[将yolov5项目打包成exe可执行文件]]></title><link>https://blog.csdn.net/apodx/article/details/123333987</link><guid>https://blog.csdn.net/apodx/article/details/123333987</guid><author>apodx</author><pubDate>Mon, 07 Mar 2022 17:23:41 +0800</pubDate><description><![CDATA[将yolov5打包成exe可执行文件]]></description><category></category></item><item><title><![CDATA[nn.Sequential的参数的注意事项]]></title><link>https://blog.csdn.net/apodx/article/details/122725395</link><guid>https://blog.csdn.net/apodx/article/details/122725395</guid><author>apodx</author><pubDate>Fri, 28 Jan 2022 00:03:15 +0800</pubDate><description><![CDATA[在Python中，*作用在形参上，代表这个位置接收任意多个非关键字参数，转化成元组方式；*作用在实参上，代表的是将输入迭代器拆成一个个元素。

从nn.Sequential的定义来看，输入要么是orderdict,要么是一系列的模型，遇到list，必须用*号进行转化，否则会报错 TypeError: list is not a Module subclass

```
# 下面的三种layer都是可以
layer = nn.Sequential(nn.Linear(10,20),nn.ReLU(),nn.L]]></description><category></category></item><item><title><![CDATA[从零安装tensorflow GPU版本]]></title><link>https://blog.csdn.net/apodx/article/details/122272529</link><guid>https://blog.csdn.net/apodx/article/details/122272529</guid><author>apodx</author><pubDate>Sun, 02 Jan 2022 00:16:40 +0800</pubDate><description><![CDATA[1. 首先是需要安装anaconda （python版本最好在2.8以上）

2. tensorflow GPU版 2.6 ，cuda 11.3版本及cudnn 8.2.1（你的电脑不一定合适这个版本）


pip install tensorflow_gpu=2.6-i https://pypi.tuna.tsinghua.edu.cn/simple
conda install cuda=11.3
conda install cudnn=8.2.1

3. 如果不知道自己的cuda版本可以使用nvdia.]]></description><category></category></item><item><title><![CDATA[Python map的一点小问题]]></title><link>https://blog.csdn.net/apodx/article/details/122019573</link><guid>https://blog.csdn.net/apodx/article/details/122019573</guid><author>apodx</author><pubDate>Sun, 19 Dec 2021 00:39:29 +0800</pubDate><description><![CDATA[在Python 3中，因为map函数处理的结果是迭代器，而且只能迭代一次，如果需要多次使用，需要提前保存。

在Python 2中则可以多次调用 这是需要注意的一点
]]></description><category></category></item><item><title><![CDATA[nn.Conv1d当kernel-size=1时的应用]]></title><link>https://blog.csdn.net/apodx/article/details/121708101</link><guid>https://blog.csdn.net/apodx/article/details/121708101</guid><author>apodx</author><pubDate>Fri, 03 Dec 2021 22:11:40 +0800</pubDate><description><![CDATA[Conv1d和Conv2d的区别



]]></description><category></category></item><item><title><![CDATA[ReLU等激活函数对tensor的一点小提示]]></title><link>https://blog.csdn.net/apodx/article/details/121706841</link><guid>https://blog.csdn.net/apodx/article/details/121706841</guid><author>apodx</author><pubDate>Fri, 03 Dec 2021 20:52:48 +0800</pubDate><description><![CDATA[a = torch.tensor([[2,-1],[3,4]])
nn.ReLU()(a)

#上面的代码等同于
m = nn.ReLU()
m(a)


]]></description><category></category></item></channel></rss>