Python精选200Tips:181-182
针对图像的经典卷积网络结构进化史及可视化
- 针对图像的经典卷积网络结构进化史及可视化(续)
- P181--MobileNet【2017】
- 模型结构及创新性说明
- 模型结构代码
- MobileNet V1版本
- MobileNet V2版本
- MobileNet V3 版本
- Small版本
- Large版本
- P182--EfficientNet【2019】
- 模型结构及创新性说明
- 模型结构代码
- B1--B7版本
运行系统:macOS Sequoia 15.0
Python编译器:PyCharm 2024.1.4 (Community Edition)
Python版本:3.12
TensorFlow版本:2.17.0
Pytorch版本:2.4.1
往期链接:
1-5 | 6-10 | 11-20 | 21-30 | 31-40 | 41-50 |
---|
51-60:函数 | 61-70:类 | 71-80:编程范式及设计模式 |
---|
81-90:Python编码规范 | 91-100:Python自带常用模块-1 |
---|
101-105:Python自带模块-2 | 106-110:Python自带模块-3 |
---|
111-115:Python常用第三方包-频繁使用 | 116-120:Python常用第三方包-深度学习 |
---|
121-125:Python常用第三方包-爬取数据 | 126-130:Python常用第三方包-为了乐趣 |
---|
131-135:Python常用第三方包-拓展工具1 | 136-140:Python常用第三方包-拓展工具2 |
---|
Python项目实战
141-145 | 146-150 | 151-155 | 156-160 | 161-165 | 166-170 | 171-175 | 176-180 |
---|
针对图像的经典卷积网络结构进化史及可视化(续)
P181–MobileNet【2017】
模型结构及创新性说明
MobileNet是一系列为移动和嵌入式视觉应用设计的轻量级卷积神经网络。以下是MobileNet各个版本的的主要特点:
(1)MobileNetV1版本
主要特点
- 引入深度可分离卷积(Depthwise Separable Convolution)
- 使用宽度乘子(Width Multiplier)和分辨率乘子(Resolution Multiplier)调整模型大小和复杂度
创新点
- 深度可分离卷积将标准卷积分解为深度卷积和逐点卷积,大大减少了计算量
- 使用ReLU6作为激活函数,有利于低精度计算
(2)MobileNetV2版本
主要特点
- 引入倒置残差结构(Inverted Residual Structure)
- 设计线性瓶颈(Linear Bottleneck)
创新点
- 倒置残差结构先扩展通道数,再做深度卷积,最后压缩回原来的通道数
- 去掉了最后一个ReLU,使用线性激活,有助于保留低维特征
(3)MobileNetV3
主要特点
- 网络结构搜索(NAS)优化的网络架构
- 引入新的激活函数:h-swish
- 集成Squeeze-and-Excitation (SE) 模块
- 提供Small和Large两个版本
创新点
- 使用NAS自动搜索最优网络结构
- h-swish激活函数提高了精度,同时计算效率高
- SE模块增强了特征的表达能力
- 优化了网络的首尾层,进一步提高效率
模型结构代码
MobileNet V1版本
import tensorflow as tf
from tensorflow.keras import layers, modelsdef depthwise_conv_block(inputs, pointwise_conv_filters, alpha,depth_multiplier=1, strides=(1, 1), block_id=1):"""Adds a depthwise convolution block.A depthwise convolution block consists of a depthwise conv,batch normalization, ReLU6, pointwise convolution,batch normalization and ReLU6 activation."""channel_axis = -1pointwise_conv_filters = int(pointwise_conv_filters * alpha)x = layers.DepthwiseConv2D((3, 3),padding='same',depth_multiplier=depth_multiplier,strides=strides,use_bias=False,name='conv_dw_%d' % block_id)(inputs)x = layers.BatchNormalization(axis=channel_axis, name='conv_dw_%d_bn' % block_id)(x)x = layers.ReLU(6., name='conv_dw_%d_relu' % block_id)(x)x = layers.Conv2D(pointwise_conv_filters, (1, 1),padding='same',use_bias=False,strides=(1, 1),name='conv_pw_%d' % block_id)(x)x = layers.BatchNormalization(axis=channel_axis, name='conv_pw_%d_bn' % block_id)(x)return layers.ReLU(6., name='conv_pw_%d_relu' % block_id)(x)def MobileNetV1(input_shape=(224, 224, 3),alpha=1.0,depth_multiplier=1,dropout=1e-3,classes=1000):"""Instantiates the MobileNet architecture.Arguments:input_shape: Optional shape tuple, to be specified if you wouldlike to use a model with an input img resolution that is not(224, 224, 3).alpha: Controls the width of the network. This is known as thewidth multiplier in the MobileNet paper.- If `alpha` < 1.0, proportionally decreases the numberof filters in each layer.- If `alpha` > 1.0, proportionally increases the numberof filters in each layer.- If `alpha` = 1, default number of filters from the paperare used at each layer.depth_multiplier: Depth multiplier for depthwise convolution.This is called the resolution multiplier in the MobileNet paper.dropout: Dropout rate.classes: Optional number of classes to classify images into.Returns:A Keras model instance."""img_input = layers.Input(shape=input_shape)x = layers.Conv2D(int(32 * alpha), (3, 3),strides=(2, 2),padding='same',use_bias=False,name='conv1')(img_input)x = layers.BatchNormalization(axis=-1, name='conv1_bn')(x)x = layers.ReLU(6., name='conv1_relu')(x)x = depthwise_conv_block(x, 64, alpha, depth_multiplier, block_id=1)x = depthwise_conv_block(x, 128, alpha, depth_multiplier, strides=(2, 2), block_id=2)x = depthwise_conv_block(x, 128, alpha, depth_multiplier, block_id=3)x = depthwise_conv_block(x, 256, alpha, depth_multiplier, strides=(2, 2), block_id=4)x = depthwise_conv_block(x, 256, alpha, depth_multiplier, block_id=5)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, strides=(2, 2), block_id=6)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, block_id=7)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, block_id=8)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, block_id=9)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, block_id=10)x = depthwise_conv_block(x, 512, alpha, depth_multiplier, block_id=11)x = depthwise_conv_block(x, 1024, alpha, depth_multiplier, strides=(2, 2), block_id=12)x = depthwise_conv_block(x, 1024, alpha, depth_multiplier, block_id=13)x = layers.GlobalAveragePooling2D()(x)x = layers.Reshape((1, 1, int(1024 * alpha)))(x)x = layers.Dropout(dropout, name='dropout')(x)x = layers.Conv2D(classes, (1, 1),padding='same',name='conv_preds')(x)x = layers.Reshape((classes,), name='reshape_2')(x)x = layers.Activation('softmax', name='act_softmax')(x)model = models.Model(img_input, x, name='mobilenet_v1')return model# 创建MobileNet V1模型
model = MobileNetV1(input_shape=(224, 224, 3), classes=1000)# 打印模型摘要
model.summary()
可以通过调整alpha参数来创建不同大小的MobileNetV1模型:
custom_model = MobileNetV1(input_shape=(224, 224, 3), classes=10, alpha=0.75)
custom_model.summary()
这将创建一个稍微窄一些(alpha=0.75)的MobileNet模型,用于10类分类任务。
MobileNet V2版本
import tensorflow as tf
from tensorflow.keras import layers, modelsdef inverted_residual_block(inputs, filters, stride, expand_ratio, alpha):input_channels = inputs.shape[-1]pointwise_filters = int(filters * alpha)# Expansion phasex = layers.Conv2D(int(input_channels * expand_ratio), kernel_size=1, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = layers.ReLU(6.)(x)# Depthwise Convolutionx = layers.DepthwiseConv2D(kernel_size=3, strides=stride, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = layers.ReLU(6.)(x)# Projectionx = layers.Conv2D(pointwise_filters, kernel_size=1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)# Residual connection if possibleif stride == 1 and input_channels == pointwise_filters:return layers.Add()([inputs, x])return xdef MobileNetV2(input_shape=(224, 224, 3), num_classes=1000, alpha=1.0, include_top=True):inputs = layers.Input(shape=input_shape)# First Convolution Layerx = layers.Conv2D(int(32 * alpha), kernel_size=3, strides=(2, 2), padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = layers.ReLU(6.)(x)# Inverted Residual Blocksx = inverted_residual_block(x, filters=16, stride=1, expand_ratio=1, alpha=alpha)x = inverted_residual_block(x, filters=24, stride=2, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=24, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=32, stride=2, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=32, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=32, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=64, stride=2, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=64, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=64, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=64, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=96, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=96, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=96, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=160, stride=2, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=160, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=160, stride=1, expand_ratio=6, alpha=alpha)x = inverted_residual_block(x, filters=320, stride=1, expand_ratio=6, alpha=alpha)# Last Convolution Layerx = layers.Conv2D(int(1280 * alpha), kernel_size=1, use_bias=False)(x)x = layers.BatchNormalization()(x)x = layers.ReLU(6.)(x)if include_top:x = layers.GlobalAveragePooling2D()(x)x = layers.Dense(num_classes, activation='softmax')(x)model = models.Model(inputs, x, name='MobileNetV2')return model# 创建MobileNet V2模型
model = MobileNetV2(input_shape=(224, 224, 3), num_classes=1000)# 打印模型摘要
model.summary()
MobileNet V3 版本
Small版本
import tensorflow as tf
from tensorflow.keras import layers, modelsclass HSwish(layers.Layer):def call(self, x):return x * tf.nn.relu6(x + 3) / 6class HSigmoid(layers.Layer):def call(self, x):return tf.nn.relu6(x + 3) / 6def squeeze_excite_block(inputs, se_ratio=0.25):x = layers.GlobalAveragePooling2D()(inputs)filters = inputs.shape[-1]x = layers.Dense(max(1, int(filters * se_ratio)), activation='relu')(x)x = layers.Dense(filters, activation=HSigmoid())(x)x = layers.Reshape((1, 1, filters))(x)return layers.multiply([inputs, x])def bneck(inputs, out_channels, exp_channels, kernel_size, stride, se_ratio, activation, alpha=1.0):x = layers.Conv2D(int(exp_channels * alpha), 1, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = activation(x)x = layers.DepthwiseConv2D(kernel_size, stride, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = activation(x)if se_ratio:x = squeeze_excite_block(x, se_ratio)x = layers.Conv2D(int(out_channels * alpha), 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)if stride == 1 and inputs.shape[-1] == int(out_channels * alpha):return layers.Add()([inputs, x])return xdef MobileNetV3Small(input_shape=(224, 224, 3), num_classes=1000, alpha=1.0, include_top=True):inputs = layers.Input(shape=input_shape)x = layers.Conv2D(16, 3, strides=2, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = HSwish()(x)x = bneck(x, 16, 16, 3, 2, 0.25, layers.ReLU(), alpha)x = bneck(x, 24, 72, 3, 2, None, layers.ReLU(), alpha)x = bneck(x, 24, 88, 3, 1, None, layers.ReLU(), alpha)x = bneck(x, 40, 96, 5, 2, 0.25, HSwish(), alpha)x = bneck(x, 40, 240, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 40, 240, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 48, 120, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 48, 144, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 96, 288, 5, 2, 0.25, HSwish(), alpha)x = bneck(x, 96, 576, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 96, 576, 5, 1, 0.25, HSwish(), alpha)x = layers.Conv2D(int(576 * alpha), 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = HSwish()(x)x = layers.GlobalAveragePooling2D()(x)x = layers.Reshape((1, 1, int(576 * alpha)))(x)x = layers.Conv2D(int(1024 * alpha), 1, padding='same')(x)x = HSwish()(x)if include_top:x = layers.Conv2D(num_classes, 1, padding='same', activation='softmax')(x)x = layers.Reshape((num_classes,))(x)model = models.Model(inputs, x, name='MobileNetV3Small')return model# 创建MobileNet V3 Small模型
model = MobileNetV3Small(input_shape=(224, 224, 3), num_classes=1000)# 打印模型摘要
model.summary()
Large版本
import tensorflow as tf
from tensorflow.keras import layers, modelsclass HSwish(layers.Layer):def call(self, x):return x * tf.nn.relu6(x + 3) / 6class HSigmoid(layers.Layer):def call(self, x):return tf.nn.relu6(x + 3) / 6def squeeze_excite_block(inputs, se_ratio=0.25):x = layers.GlobalAveragePooling2D()(inputs)filters = inputs.shape[-1]x = layers.Dense(max(1, int(filters * se_ratio)), activation='relu')(x)x = layers.Dense(filters, activation=HSigmoid())(x)x = layers.Reshape((1, 1, filters))(x)return layers.multiply([inputs, x])def bneck(inputs, out_channels, exp_channels, kernel_size, stride, se_ratio, activation, alpha=1.0):x = layers.Conv2D(int(exp_channels * alpha), 1, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = activation(x)x = layers.DepthwiseConv2D(kernel_size, stride, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = activation(x)if se_ratio:x = squeeze_excite_block(x, se_ratio)x = layers.Conv2D(int(out_channels * alpha), 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)if stride == 1 and inputs.shape[-1] == int(out_channels * alpha):return layers.Add()([inputs, x])return xdef MobileNetV3Large(input_shape=(224, 224, 3), num_classes=1000, alpha=1.0, include_top=True):inputs = layers.Input(shape=input_shape)x = layers.Conv2D(16, 3, strides=2, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = HSwish()(x)x = bneck(x, 16, 16, 3, 1, None, layers.ReLU(), alpha)x = bneck(x, 24, 64, 3, 2, None, layers.ReLU(), alpha)x = bneck(x, 24, 72, 3, 1, None, layers.ReLU(), alpha)x = bneck(x, 40, 72, 5, 2, 0.25, layers.ReLU(), alpha)x = bneck(x, 40, 120, 5, 1, 0.25, layers.ReLU(), alpha)x = bneck(x, 40, 120, 5, 1, 0.25, layers.ReLU(), alpha)x = bneck(x, 80, 240, 3, 2, None, HSwish(), alpha)x = bneck(x, 80, 200, 3, 1, None, HSwish(), alpha)x = bneck(x, 80, 184, 3, 1, None, HSwish(), alpha)x = bneck(x, 80, 184, 3, 1, None, HSwish(), alpha)x = bneck(x, 112, 480, 3, 1, 0.25, HSwish(), alpha)x = bneck(x, 112, 672, 3, 1, 0.25, HSwish(), alpha)x = bneck(x, 160, 672, 5, 2, 0.25, HSwish(), alpha)x = bneck(x, 160, 960, 5, 1, 0.25, HSwish(), alpha)x = bneck(x, 160, 960, 5, 1, 0.25, HSwish(), alpha)x = layers.Conv2D(int(960 * alpha), 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = HSwish()(x)x = layers.GlobalAveragePooling2D()(x)x = layers.Reshape((1, 1, int(960 * alpha)))(x)x = layers.Conv2D(int(1280 * alpha), 1, padding='same')(x)x = HSwish()(x)if include_top:x = layers.Conv2D(num_classes, 1, padding='same', activation='softmax')(x)x = layers.Reshape((num_classes,))(x)model = models.Model(inputs, x, name='MobileNetV3Large')return model# 创建MobileNet V3 Large模型
model = MobileNetV3Large(input_shape=(224, 224, 3), num_classes=1000)# 打印模型摘要
model.summary()
P182–EfficientNet【2019】
模型结构及创新性说明
EfficientNet是由Google研究人员在2019年提出的一系列卷积神经网络模型,旨在提高模型效率和准确性。以下是EfficientNet的主要特点:
模型结构
- 基于MobileNetV2的倒置残差结构
- 使用Squeeze-and-Excitation (SE) 块
- 采用复合缩放方法
创新性:
- 提出了复合缩放方法,同时缩放网络的宽度、深度和分辨率
- 通过神经架构搜索(NAS)优化基础网络结构
- 在同等计算资源下,实现了更高的准确率
模型结构代码
B0版本
import matplotlib.pyplot as plt
import tensorflow as tf
from keras.utils import plot_model
from tensorflow.keras import layers, models# macos系统显示中文
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS']def swish(x):return x * tf.nn.sigmoid(x)def se_block(inputs, se_ratio):channels = inputs.shape[-1]x = layers.GlobalAveragePooling2D()(inputs)x = layers.Dense(max(1, int(channels * se_ratio)), activation=swish)(x)x = layers.Dense(channels, activation='sigmoid')(x)return layers.Multiply()([inputs, x])def mbconv_block(inputs, out_channels, expand_ratio, stride, kernel_size, se_ratio):channels = inputs.shape[-1]x = inputs# Expansion phaseif expand_ratio != 1:expand_channels = channels * expand_ratiox = layers.Conv2D(expand_channels, 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = layers.Activation(swish)(x)# Depthwise Convx = layers.DepthwiseConv2D(kernel_size, stride, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = layers.Activation(swish)(x)# Squeeze and Excitationif se_ratio:x = se_block(x, se_ratio)# Output phasex = layers.Conv2D(out_channels, 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)if stride == 1 and channels == out_channels:x = layers.Add()([inputs, x])return xdef efficientnet(width_coefficient, depth_coefficient, resolution, dropout_rate):base_architecture = [# expansion, channels, repeats, stride, kernel_size[1, 16, 1, 1, 3],[6, 24, 2, 2, 3],[6, 40, 2, 2, 5],[6, 80, 3, 2, 3],[6, 112, 3, 1, 5],[6, 192, 4, 2, 5],[6, 320, 1, 1, 3]]inputs = layers.Input(shape=(resolution, resolution, 3))x = layers.Conv2D(32, 3, strides=2, padding='same', use_bias=False)(inputs)x = layers.BatchNormalization()(x)x = layers.Activation(swish)(x)for i, (expansion, channels, repeats, stride, kernel_size) in enumerate(base_architecture):channels = int(channels * width_coefficient)repeats = int(repeats * depth_coefficient)for j in range(repeats):x = mbconv_block(x, channels, expansion, stride if j == 0 else 1, kernel_size, se_ratio=0.25)x = layers.Conv2D(1280, 1, padding='same', use_bias=False)(x)x = layers.BatchNormalization()(x)x = layers.Activation(swish)(x)x = layers.GlobalAveragePooling2D()(x)if dropout_rate > 0:x = layers.Dropout(dropout_rate)(x)outputs = layers.Dense(1000, activation='softmax')(x)model = tf.keras.Model(inputs, outputs)return model# EfficientNet-B0 configuration
def efficientnet_b0():return efficientnet(width_coefficient=1.0,depth_coefficient=1.0,resolution=224,dropout_rate=0.2)# Create the model
model_b0 = efficientnet_b0()# Print model summary
model_b0.summary()# 将模型结构输出到pdf
plot_model(model_b0, to_file='model_b0.pdf', show_shapes=True,show_layer_names=True)
B1–B7版本
def efficientnet_b1():return efficientnet(width_coefficient=1.0, depth_coefficient=1.1, resolution=240, dropout_rate=0.2)def efficientnet_b2():return efficientnet(width_coefficient=1.1, depth_coefficient=1.2, resolution=260, dropout_rate=0.3)def efficientnet_b3():return efficientnet(width_coefficient=1.2, depth_coefficient=1.4, resolution=300, dropout_rate=0.3)def efficientnet_b4():return efficientnet(width_coefficient=1.4, depth_coefficient=1.8, resolution=380, dropout_rate=0.4)def efficientnet_b5():return efficientnet(width_coefficient=1.6, depth_coefficient=2.2, resolution=456, dropout_rate=0.4)def efficientnet_b6():return efficientnet(width_coefficient=1.8, depth_coefficient=2.6, resolution=528, dropout_rate=0.5)def efficientnet_b7():return efficientnet(width_coefficient=2.0, depth_coefficient=3.1, resolution=600, dropout_rate=0.5)
相关文章:
Python精选200Tips:181-182
针对图像的经典卷积网络结构进化史及可视化 针对图像的经典卷积网络结构进化史及可视化(续)P181--MobileNet【2017】模型结构及创新性说明模型结构代码MobileNet V1版本MobileNet V2版本MobileNet V3 版本Small版本Large版本 P182--EfficientNet【2019】…...

SpringCloud 配置 feign.hystrix.enabled: true 不生效
SpringCloud 配置 feign.hystrix.enabled: true 不生效的原因 feign 启用 hystrix feign 默认没有启用 hystrix,添加配置,启用 hystrix feign.hystrix.enabledtrue application.yml 添加配置 feign:hystrix:enabled: true启用 hystrix 后,访…...

9.24-k8s服务发布
Ingress 使用域名发布 K8S 服务 部署项目 一、先部署mariadb [rootk8s-master ~]# mkdir aaa [rootk8s-master ~]# cd aaa/ [rootk8s-master aaa]# # 先部署mariadb [rootk8s-master aaa]# # configmap [rootk8s-master aaa]# vim mariadb-configmap.yaml apiVersion: v1 ki…...
UI设计师面试整理-作品集展示
在UI设计师的面试中,作品集展示是非常关键的一环。它不仅展示了你的设计技能和风格,也让面试官了解你的设计思维和解决问题的能力。下面是如何有效地准备和展示你的作品集的建议: 1. 选择合适的项目 ● 多样性:选择能展示你在不同领域或平台上的设计能力的项目。确保作品集…...
CMU 10423 Generative AI:lec10(few-shot、提示工程、上下文学习)
文章目录 1 概述2 摘录2.1 zero-shot 和 few-shot一、Zero-shot Learning(零样本学习)特点:工作原理:优点:缺点: 二、Few-shot Learning(少样本学习)特点:工作原理&#…...
做数据抓取工作要如何选择ip池
选择合适的IP池对于数据抓取工作至关重要。一个优质的IP池可以提高抓取的效率和成功率,同时减少被目标网站封禁的风险。以下是选择IP池时需要考虑的一些关键因素: 1. IP类型 住宅IP:住宅IP通常来自真实用户,难以被识别为代理。它…...

防止电脑电池老化,禁止usb或者ac接口调试时充电
控制android系统,开发者模式,开启和禁止充电 连接 Android 手机到电脑的 USB 端口。 下载并安装 Android Debug Bridge (ADB) 工具[1]。 USB: 在命令行中输入 adb shell dumpsys battery set usb 0,以禁止 USB 充电。 在命令…...
智权半导体/SmartDV力助高速发展的中国RISC-V CPU IP厂商走上高质量发展之道
作者:Karthik Gopal SmartDV Technologies亚洲区总经理 智权半导体科技(厦门)有限公司总经理 进入2024年,全球RISC-V社群在技术和应用两个方向上都在加快发展,中国国内的RISC-V CPU IP提供商也在内核性能和应用扩展…...

利用vue-capper封装一个可以函数式调用图片裁剪组件
1. 效果 const cropData await wqCrop({prop:{img,autoCrop: true, // 是否开启截图框maxImgSize: 600,autoCropWidth: 30,canMove: true, // 图片是否可移动canMoveBox: true, // 截图框是否可移动fixedBox: false, // 截图框是否固定}});console.log(cropData);使用wqCrop会…...

在系统开发中提升 Excel 数据导出一致性与可维护性的统一规范与最佳实践
背景: 在系统开发过程中,数据导出为 Excel 格式是一个常见的需求。然而,由于各个开发人员的编码习惯和实现方式不同,导致导出代码风格不一。有的人使用第三方库,有的人则自定义实现。这种多样化不仅影响了代码的一致性…...

SpringAOP学习
面向切面编程,指导开发者如何组织程序结构 增强原始设计的功能 oop:面向对象编程 1.导入aop相关坐标,创建 <!--spring依赖--><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spri…...

智能网联汽车飞速发展,安全危机竟如影随形,如何破局?
随着人工智能、5G通信、大数据等技术的飞速发展,智能网联汽车正在成为全球汽车行业的焦点。特别是我国智能网联汽车市场规模近年来呈现快速增长态势,彰显了行业蓬勃发展的活力与潜力。然而,车联网技术的广泛应用也带来了一系列网络安全问题&a…...
Android常用C++特性之std::function
声明:本文内容生成自ChatGPT,目的是为方便大家了解学习作为引用到作者的其他文章中。 std::function 是 C 标准库中的一个 函数包装器,用于存储、复制、调用任何可以调用的目标(如普通函数、lambda 表达式、函数对象、成员函数等&…...
人工智能与机器学习原理精解【27】
文章目录 集成学习集成学习概述集成学习的定义集成学习的性质集成学习的算法过程集成学习的算法描述集成学习的例子和例题Julia实现集成学习 集成学习数学原理一、基学习器的生成Bagging(装袋法)Boosting(提升法) 二、基学习器的结…...
XXL-JOB在SpringBoot中的集成
在SpringBoot中,XXL-JOB作为一个轻量级的分布式任务调度平台,提供了灵活的任务分片处理功能,这对于处理大规模、复杂的任务场景尤为重要。以下将详细探讨如何在SpringBoot中利用XXL-JOB实现灵活控制的分片处理方案,涵盖配置、代码…...

前端工程规范-3:CSS规范(Stylelint)
样式规范工具(StyleLint) Stylelint 是一个灵活且强大的工具,适用于保持 CSS 代码的质量和一致性。结合其他工具(如 Prettier 和 ESLint),可以更全面地保障前端代码的整洁性和可维护性。 目录 样式规范工具…...
Qt系列-1.Qt安装
Qt安装 0 简介 1.安装步骤 1.1 下载 进入qt中文网站:https://www.qt.io/zh-cn/ Qt开源社区版本:https://www.qt.io/download-open-source#source 1.2 安装 chmod +x qt-online-installer-linux-x64-4.8.0.run ./qt-online-installer-linux-x64-4.8.0.run 外网不能下载…...

《自控原理》最小相位系统
在复平面右半平面既没有零点,也没有极点的系统,称为最小相位系统,其余均为非最小相位系统。 从知乎看了一篇答案: https://www.zhihu.com/question/24163919 证明过程大概率比较难,我翻了两本自控的教材,…...

SpringBoot3脚手架
MySpringBootAPI SpringBoot3脚手架,基于SpringBoot3DruidPgSQLMyBatisPlus13FastJSON2Lombok,启动web容器为Undertow(非默认tomcat),其他的请自行添加和配置。 <java.version>17</java.version> <springboot.version>3.3…...

【C语言软开面经】
C语言软开面经 malloc calloc realloc free动态分配内存malloccalloc函数:realloc 函数:free函数: 堆栈-内存分区栈区(Stack):堆区(Heap):全局(静态ÿ…...

网络编程(Modbus进阶)
思维导图 Modbus RTU(先学一点理论) 概念 Modbus RTU 是工业自动化领域 最广泛应用的串行通信协议,由 Modicon 公司(现施耐德电气)于 1979 年推出。它以 高效率、强健性、易实现的特点成为工业控制系统的通信标准。 包…...
设计模式和设计原则回顾
设计模式和设计原则回顾 23种设计模式是设计原则的完美体现,设计原则设计原则是设计模式的理论基石, 设计模式 在经典的设计模式分类中(如《设计模式:可复用面向对象软件的基础》一书中),总共有23种设计模式,分为三大类: 一、创建型模式(5种) 1. 单例模式(Sing…...
FastAPI 教程:从入门到实践
FastAPI 是一个现代、快速(高性能)的 Web 框架,用于构建 API,支持 Python 3.6。它基于标准 Python 类型提示,易于学习且功能强大。以下是一个完整的 FastAPI 入门教程,涵盖从环境搭建到创建并运行一个简单的…...
Linux云原生安全:零信任架构与机密计算
Linux云原生安全:零信任架构与机密计算 构建坚不可摧的云原生防御体系 引言:云原生安全的范式革命 随着云原生技术的普及,安全边界正在从传统的网络边界向工作负载内部转移。Gartner预测,到2025年,零信任架构将成为超…...
Robots.txt 文件
什么是robots.txt? robots.txt 是一个位于网站根目录下的文本文件(如:https://example.com/robots.txt),它用于指导网络爬虫(如搜索引擎的蜘蛛程序)如何抓取该网站的内容。这个文件遵循 Robots…...

Spring数据访问模块设计
前面我们已经完成了IoC和web模块的设计,聪明的码友立马就知道了,该到数据访问模块了,要不就这俩玩个6啊,查库势在必行,至此,它来了。 一、核心设计理念 1、痛点在哪 应用离不开数据(数据库、No…...

Reasoning over Uncertain Text by Generative Large Language Models
https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829https://ojs.aaai.org/index.php/AAAI/article/view/34674/36829 1. 概述 文本中的不确定性在许多语境中传达,从日常对话到特定领域的文档(例如医学文档)(Heritage 2013;Landmark、Gulbrandsen 和 Svenevei…...
服务器--宝塔命令
一、宝塔面板安装命令 ⚠️ 必须使用 root 用户 或 sudo 权限执行! sudo su - 1. CentOS 系统: yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh2. Ubuntu / Debian 系统…...

基于TurtleBot3在Gazebo地图实现机器人远程控制
1. TurtleBot3环境配置 # 下载TurtleBot3核心包 mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git git clone -b noetic https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git git clone -b noetic-dev…...
Mysql8 忘记密码重置,以及问题解决
1.使用免密登录 找到配置MySQL文件,我的文件路径是/etc/mysql/my.cnf,有的人的是/etc/mysql/mysql.cnf 在里最后加入 skip-grant-tables重启MySQL服务 service mysql restartShutting down MySQL… SUCCESS! Starting MySQL… SUCCESS! 重启成功 2.登…...