宽度学习(Broad Learning System, BLS)是一种有效的神经网络学习框架,旨在通过扩展网络的宽度而不是深度来提高学习能力和效率。与传统的深度学习相比,宽度学习通过堆叠多层特征节点和增强节点来构建网络,从而避免了深度学习中常见的梯度消失和复杂的训练过程。
BLS结构以及增量算法
宽度学习系统在 RVFLNN 基础上做出了改进。首先,宽度学习可以利用别的模型提取到的特征来训练,即可以和别的机器学习算法灵活地结合。其次,宽度学习中加入了增量学习算法,它允许在网络结构中加入新的结点时,以很小的计算开销来更新网络权重。这一特性使 BLS 在面对大规模的数据时,相对于深度结构具有巨大的优势。
通过 (a) 图基于 Pytorch 简单实现的 BLS 模型 :
class BLS(nn.Module):
def __init__(self, input_dim, num_feature_nodes, num_enhancement_nodes, output_dim):
super(BLS, self).__init__()
# Step 1: Define feature mapping layers
self.feature_layers = nn.ModuleList([nn.Sequential(
nn.Linear(input_dim, num_feature_nodes),
nn.ReLU()) for _ in range(num_feature_nodes)])
# Step 2: Define enhancement nodes
self.enhancement_layers = nn.ModuleList([nn.Sequential(
nn.Linear(num_feature_nodes * num_feature_nodes, num_enhancement_nodes), # 100,400
nn.ReLU()) for _ in range(1)])
# Step 3: Output layer
self.output_layer = nn.Linear(
num_feature_nodes * num_feature_nodes + num_enhancement_nodes, output_dim)
def forward(self, x):
print(x.shape) # torch.Size([32, 224])
# Generate feature nodes Z^n
Z = torch.cat([layer(x) for layer in self.feature_layers], dim = 1)
print(Z.shape) # torch.Size([32, 100])
# Generate enhancement nodes H^m
H = torch.cat([layer(Z) for layer in self.enhancement_layers], dim = 1)
print(H.shape) # torch.Size([32, 25])
# Concatenate and predict
combined = torch.cat((Z, H), dim = 1)
print(combined.shape) # torch.Size([32, 125])
output = self.output_layer(combined)
print(output.shape) # torch.Size([32, 1])
return output
通过 (b) 图基于 Pytorch 简单实现的 BLS 模型 :
class BLSv2(nn.Module):
def __init__(self, input_dim, num_feature_nodes, num_enhancement_nodes, output_dim):
super(BLSv2, self).__init__()
# Step 1: Define feature mapping layers
self.feature_layers = nn.ModuleList([nn.Sequential(
nn.Linear(input_dim, num_feature_nodes),
nn.ReLU()) for _ in range(num_feature_nodes)])
# Step 2: Define enhancement nodes
self.enhancement_layers = nn.ModuleList([nn.Sequential(
nn.Linear(num_feature_nodes * num_feature_nodes, num_enhancement_nodes), # 100,20
nn.ReLU()) for _ in range(num_enhancement_nodes)])
# Step 3: Output layer
self.output_layer = nn.Linear(
num_feature_nodes * num_feature_nodes + num_enhancement_nodes * num_enhancement_nodes, output_dim)
def forward(self, x):
print(x.shape) # torch.Size([32, 224])
# Generate feature nodes Z^n
Z = torch.cat([layer(x) for layer in self.feature_layers], dim = 1)
print(Z.shape) # torch.Size([32, 100])
# Generate enhancement nodes H^m
H = torch.cat([layer(Z) for layer in self.enhancement_layers], dim = 1)
print(H.shape) # torch.Size([32, 25])
# Concatenate and predict
combined = torch.cat((Z, H), dim = 1)
print(combined.shape) # torch.Size([32, 125])
output = self.output_layer(combined)
print(output.shape) # torch.Size([32, 1])
return output
更多资料:
宽度学习系统(BLS)的原理、变体形式及当前应用(随时更新……)「建议收藏」-腾讯云开发者社区-腾讯云 (tencent.com)
DeepLearning | Broad Learning System 宽度学习系统 : 高效增量式浅层神经网络-CSDN博客