BiFormer 实验记录

news2024/10/7 4:35:00

代码来自文中地址

目录

一、前向传播过程

1、Path Embedding

2、BiFormer Block

BRA模块

网络结构


一、前向传播过程

1、Path Embedding

见网络结构部分,4倍下采样

2、BiFormer Block

 对应

x = x + self.pos_embed(x)

 对应

x = x + self.drop_path(self.attn(self.norm1(x)))

接下来仔细记录其中的细节。

BRA模块

BRA模块的运行需要满足前提条件

        else:  # True
            N, H, W, C = x.size()  # 1,56,56,64
            assert H%self.n_win == 0 and W%self.n_win == 0

其中的self.n_win就是 论文中的 S,论文中

 以及论文中的 Algorithm1

# patchify input (H, W, C) -> (Sˆ2, HW/Sˆ2, C)
x = patchify(input, patch_size=H//S)

对应代码

# patchify, (n, p^2, w, w, c), keep 2d window as we need 2d pooling to reduce kv size
x = rearrange(x, "n (j h) (i w) c -> n (j i) h w c", j=self.n_win, i=self.n_win)  # (1,49,8,8,64)

论文中的公式3

以及Algorithm1中的

# linear projection of query, key, value
query, key, value = linear_qkv(x).chunk(3, dim=-1)

对应

q, kv = self.qkv(x)  # to 103  q (1,49,8,8,64) kv (1,49,8,8,128)

# pixel-wise qkv
# q_pix: (n, p^2, w^2, c_qk)
# kv_pix: (n, p^2, h_kv*w_kv, c_qk+c_v)
q_pix = rearrange(q, 'n p2 h w c -> n p2 (h w) c')  # (1,49,64,64)
kv_pix = self.kv_down(rearrange(kv, 'n p2 h w c -> (n p2) c h w'))  # (49,128,8,8)
kv_pix = rearrange(kv_pix, '(n j i) c h w -> n (j i) (h w) c', j=self.n_win, i=self.n_win)  # (1,49,64,128)

只不过这里将 k v 放在一起了。

 论文中

 对应

q_win, k_win = q.mean([2, 3]), kv[..., 0:self.qk_dim].mean([2, 3])  # window-wise qk, (n, p^2, c_qk), (n, p^2, c_qk) q_win (1,49,64) k_win (1,49,64)  这里是k_min所以截至到0:self.dim

这个不是按通道进行平均,而是按 每个区域的8x8个vector进行平均 

代码中接下来会执行

lepe = self.lepe(rearrange(kv[..., self.qk_dim:], 'n (j i) h w c -> n c (j h) (i w)', j=self.n_win, i=self.n_win).contiguous())  # (1,64,56,56)
lepe = rearrange(lepe, 'n c (j h) (i w) -> n (j h) (i w) c', j=self.n_win, i=self.n_win)  # (1,56,56,64)

 对应文中的公式7中的LCE(V)

 文本的公式4 和公式5

 分别由

 r_weight, r_idx = self.router(q_win, k_win)  # both are (n, p^2, topk) tensors to 51 (1,49,1) (1,49,1)

 返回,里面的前向传播

    def forward(self, query:Tensor, key:Tensor)->Tuple[Tensor]:  # q (1,49,64), k (1,49,64)
        """
        Args:
            q, k: (n, p^2, c) tensor
        Return:
            r_weight, topk_index: (n, p^2, topk) tensor
        """
        if not self.diff_routing:  # True
            query, key = query.detach(), key.detach()
        query_hat, key_hat = self.emb(query), self.emb(key)  # per-window pooling -> (n, p^2, c) (1,49,64)
        attn_logit = (query_hat*self.scale) @ key_hat.transpose(-2, -1)  # (n, p^2, p^2)  (1,49,49)
        topk_attn_logit, topk_index = torch.topk(attn_logit, k=self.topk, dim=-1)  # (n, p^2, k), (n, p^2, k) (1,49,1) (1,49,1)
        r_weight = self.routing_act(topk_attn_logit)  # (n, p^2, k) (1,49,1)
        
        return r_weight, topk_index

 self.emb 为 Identity 恒等函数,然后进行公式4 attention,拿出top k 个,self.routing_act为softmax激活函数。这个过程,可以看到,经过attention的输出为 (1,49,49),第一个49表是区域数,第二个49表示每一个区域与其它区域的 affifinity graph 分数,按通道 -1拿出top k 个 最大分数和索引。

文中公式6

 对应

kv_pix_sel = self.kv_gather(r_idx=r_idx, r_weight=r_weight, kv=kv_pix)  #(n, p^2, topk, h_kv*w_kv, c_qk+c_v)  (1,49,1,64,128)
k_pix_sel, v_pix_sel = kv_pix_sel.split([self.qk_dim, self.dim], dim=-1)  # (1,49,1,64,64)  (1,49,1,64,64)

self.kv_gather没啥好说的。

然后进行多头 self attention,对应论文中的公式7

k_pix_sel = rearrange(k_pix_sel, 'n p2 k w2 (m c) -> (n p2) m c (k w2)', m=self.num_heads)  # flatten to BMLC, (n*p^2, m, topk*h_kv*w_kv, c_kq//m) transpose here?  (49,2,32,64)
v_pix_sel = rearrange(v_pix_sel, 'n p2 k w2 (m c) -> (n p2) m (k w2) c', m=self.num_heads) # flatten to BMLC, (n*p^2, m, topk*h_kv*w_kv, c_v//m)  (49,2,64,32)
q_pix = rearrange(q_pix, 'n p2 w2 (m c) -> (n p2) m w2 c', m=self.num_heads) # to BMLC tensor (n*p^2, m, w^2, c_qk//m)  (49,2,64,32)

# param-free multihead attention
attn_weight = (q_pix * self.scale) @ k_pix_sel # (n*p^2, m, w^2, c) @ (n*p^2, m, c, topk*h_kv*w_kv) -> (n*p^2, m, w^2, topk*h_kv*w_kv)  (49,2,64,64)
attn_weight = self.attn_act(attn_weight)  # (49,2,64,64)
out = attn_weight @ v_pix_sel # (n*p^2, m, w^2, topk*h_kv*w_kv) @ (n*p^2, m, topk*h_kv*w_kv, c) -> (n*p^2, m, w^2, c)  (49,2,64,32)
out = rearrange(out, '(n j i) m (h w) c -> n (j h) (i w) (m c)', j=self.n_win, i=self.n_win,
                        h=H//self.n_win, w=W//self.n_win)  # (1,56,56,64)

out = out + lepe  # (1,56,56,64)

 这里将 n 和SxS 合并在一起了,也就是batch和 区域数,最后输出重新reshape回 H W。

最后再经过一个线性层输出。

接下来进入 mlp模块,没什么好说的。

网络结构

BiFormer--T

BiFormer(
  (downsample_layers): ModuleList(
    (0): Sequential(
      (0): Conv2d(3, 32, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): GELU()
      (3): Conv2d(32, 64, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (4): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
    (1): Sequential(
      (0): Conv2d(64, 128, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (1): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
    (2): Sequential(
      (0): Conv2d(128, 256, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (1): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
    (3): Sequential(
      (0): Conv2d(256, 512, kernel_size=(3, 3), stride=(2, 2), padding=(1, 1))
      (1): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    )
  )
  (stages): ModuleList(
    (0): Sequential(
      (0): Block(
        (pos_embed): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64)
        (norm1): LayerNorm((64,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(64, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=64)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=64, out_features=192, bias=True)
          )
          (wo): Linear(in_features=64, out_features=64, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((64,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=64, out_features=192, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=192, out_features=64, bias=True)
        )
        (drop_path): Identity()
      )
      (1): Block(
        (pos_embed): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=64)
        (norm1): LayerNorm((64,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(64, 64, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=64)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=64, out_features=192, bias=True)
          )
          (wo): Linear(in_features=64, out_features=64, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((64,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=64, out_features=192, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=192, out_features=64, bias=True)
        )
        (drop_path): Identity()
      )
    )
    (1): Sequential(
      (0): Block(
        (pos_embed): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128)
        (norm1): LayerNorm((128,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(128, 128, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=128)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=128, out_features=384, bias=True)
          )
          (wo): Linear(in_features=128, out_features=128, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((128,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=128, out_features=384, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=384, out_features=128, bias=True)
        )
        (drop_path): Identity()
      )
      (1): Block(
        (pos_embed): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=128)
        (norm1): LayerNorm((128,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(128, 128, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=128)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=128, out_features=384, bias=True)
          )
          (wo): Linear(in_features=128, out_features=128, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((128,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=128, out_features=384, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=384, out_features=128, bias=True)
        )
        (drop_path): Identity()
      )
    )
    (2): Sequential(
      (0): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (1): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (2): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (3): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (4): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (5): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (6): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
      (7): Block(
        (pos_embed): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=256)
        (norm1): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (attn): BiLevelRoutingAttention(
          (lepe): Conv2d(256, 256, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=256)
          (router): TopkRouting(
            (emb): Identity()
            (routing_act): Softmax(dim=-1)
          )
          (kv_gather): KVGather()
          (qkv): QKVLinear(
            (qkv): Linear(in_features=256, out_features=768, bias=True)
          )
          (wo): Linear(in_features=256, out_features=256, bias=True)
          (kv_down): Identity()
          (attn_act): Softmax(dim=-1)
        )
        (norm2): LayerNorm((256,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=256, out_features=768, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=768, out_features=256, bias=True)
        )
        (drop_path): Identity()
      )
    )
    (3): Sequential(
      (0): Block(
        (pos_embed): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=512)
        (norm1): LayerNorm((512,), eps=1e-06, elementwise_affine=True)
        (attn): AttentionLePE(
          (qkv): Linear(in_features=512, out_features=1536, bias=False)
          (attn_drop): Dropout(p=0.0, inplace=False)
          (proj): Linear(in_features=512, out_features=512, bias=True)
          (proj_drop): Dropout(p=0.0, inplace=False)
          (lepe): Conv2d(512, 512, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=512)
        )
        (norm2): LayerNorm((512,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=512, out_features=1536, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=1536, out_features=512, bias=True)
        )
        (drop_path): Identity()
      )
      (1): Block(
        (pos_embed): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=512)
        (norm1): LayerNorm((512,), eps=1e-06, elementwise_affine=True)
        (attn): AttentionLePE(
          (qkv): Linear(in_features=512, out_features=1536, bias=False)
          (attn_drop): Dropout(p=0.0, inplace=False)
          (proj): Linear(in_features=512, out_features=512, bias=True)
          (proj_drop): Dropout(p=0.0, inplace=False)
          (lepe): Conv2d(512, 512, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2), groups=512)
        )
        (norm2): LayerNorm((512,), eps=1e-06, elementwise_affine=True)
        (mlp): Sequential(
          (0): Linear(in_features=512, out_features=1536, bias=True)
          (1): Identity()
          (2): GELU()
          (3): Linear(in_features=1536, out_features=512, bias=True)
        )
        (drop_path): Identity()
      )
    )
  )
  (norm): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
  (pre_logits): Identity()
  (head): Linear(in_features=512, out_features=1000, bias=True)
)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/554372.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【5.22】七、移动App测试

目录 7.1 移动App测试概述 1. 移动App特性 2. 移动App测试与传统软件测试的区别 7.2 移动App测试要点 7.2.1 UI测试 7.2.2 功能测试 7.2.3 专项测试 7.2.4 性能测试 7.3 移动App测试流程 第三方测试平台 7.4 移动App测试工具 7.1 移动App测试概述 移动App&#xff…

就业内推 | 应届生专场,有华为、思科认证优先,六险一金

01 金科 🔷招聘岗位:网络工程师 🔷职责描述: 1、为银行、企业客户提供技术服务(包括驻场支持和现场技术支持); 2、驻客户现场配合客户完成思科、华三、华为主流网络设备的配置、管理&#xff1…

基于C++的类UNIX文件系统

访问【WRITE-BUG数字空间】_[内附完整源码和文档] 一、题目要求 使用一个普通的大文件(如 c:\myDisk.img ,称之为一级文件)模拟 UNIX V6的一个文件卷,一个文件卷实际上就是一张逻辑磁盘,磁盘中存储的信息以块为单位。…

小航助学2023年3月GESP_C++一级试卷(含题库答题软件账号)

GESP在线模拟训练系统请点击 电子学会-全国青少年编程等级考试真题Scratch一级(2019年3月)在线答题_程序猿下山的博客-CSDN博客_小航答题助手 答案:B 第1题以下不属于计算机输入设备的有( )。 A、键盘B、音箱C、鼠标D、传感器 …

如何使用Python和wxPython构建一个HTML Title提取工具

以下代码可以用于以下场景: 在Web开发中,获取网页中的Title内容,以用于页面SEO。在数据挖掘和分析中,获取包含Title信息的HTML页面,以进行进一步的文本处理和分析。在一些需要从HTML源代码中获取元数据的应用中&#…

STM32单片机语音识别家庭灯光控制系统

实践制作DIY- GC0132-语音识别家庭灯光控制系统 一、功能说明: 基于STM32单片机设计-语音识别家庭灯光控制系统 二、功能介绍: STM32F103C系列最小系统板语音识别模块18650锂电池太阳能充电板LCD1602显示器4个LED灯板对应卧室、厨房、客厅、厕所…

Springboot +spring security,自定义认证器实现验证码功能

一.简介 SpringSecurity 默认是不支持验证码功能的,但是可以自己扩展,这也是使用SpringSecurity的好处之一,原生不支持,我们就自己扩展。 二.思路分析 因为系统默认的有一个DaoAuthenticationProvider 认证处理器,但…

springboot+java高校学生学分置换系统安全开发

本选题具有以下5个方面的意义: (1)减少人工的繁琐宣传组织统计时间,提高工作效率和工作精确度以扩大比赛的规模[4]。 (2)将人工阶段难以实现的公开、公正、公平,通过多方监督的方法进行解决。 &…

美陆军面向战场物联网的边缘智能发展综述

欢迎关注博主 Mindtechnist 或加入【Linux C/C/Python社区】一起学习和分享Linux、C、C、Python、Matlab,机器人运动控制、多机器人协作,智能优化算法,滤波估计、多传感器信息融合,机器学习,人工智能等相关领域的知识和…

UVC调用过程部分细节分析

UVC调用过程部分细节分析 文章目录 UVC调用过程部分细节分析概括分析UVC驱动调用过程1.open:ioctl 2.VIDIOC_QUERYCAP3.VIDIOC_ENUM_FMT4.VIDIOC_G_FMT5.VIDIOC_TRY_FMT6.VIDIOC_S_FMT /7.VIDIOC_REQBUFS8.VIDIOC_QUERYBUF9.mmap10.VIDIOC_QBUF11.VIDIOC_STREAMON12.poll13.VID…

基于Java+SpringBoot+vue+element实现校园疫情防控系统详细设计和实现

基于JavaSpringBootvueelement实现校园疫情防控系统详细设计和实现 博主介绍:5年java开发经验,专注Java开发、定制、远程、指导等,csdn特邀作者、专注于Java技术领域 作者主页 超级帅帅吴 Java项目精品实战案例《500套》 欢迎点赞 收藏 ⭐留言 文末获取源…

好用又便宜的平替苹果笔有哪些?平价的平板触控笔推荐

苹果的Pencil在最近一直都受到市场的追捧,而苹果原装的那款电容笔,除了性能好,还有就是价格贵了点。当然,你也可以使用这款Apple Pencil,但是,如果你不愿意花费太多的钱,可以选择一个平替的电容…

低功耗红外测距感应模块 引领皂液机的革新应用方案WTU201F2 B004

作为现代社会卫生意识的提升,智能洗手设备在公共场所的普及变得越来越重要。为了满足市场需求,唯创知音推出了全新的WTU201F2 B004红外测距模块,作为皂液机红外感应模块,凭借其低功耗和小体积的特点,这款模组将成为开发…

本地电脑部署微力同步私人网盘,端口映射实现远程访问

✨个人主页:bit me👇 目 录 🐾1.前言💐2. 微力同步网站搭建🌸2.1 微力同步下载和安装🌷2.2 微力同步网页测试🍀2.3 cpolar的安装和注册 🌹3.本地网页发布🌻3.1 Cpolar云端…

新增Video-Worker组件,支持会话录像自动转MP4格式,JumpServer堡垒机v3.3.0发布

2023年5月22日,JumpServer开源堡垒机正式发布v3.3.0版本。在这一版本中,资产连接令牌支持在有效期内不限次数地复用;用户登录方式(包含钉钉、飞书、企业微信扫码登录)支持当不存在的用户扫码登录后,自动创建…

【C++】函数提高

欢迎来到博主 Apeiron 的博客,祝您旅程愉快 !时止则止,时行则行。动静不失其时,其道光明。 目录 1、缘起 2、函数默认参数 3、函数占位参数 4、总结 1、缘起 以前学习过了函数的基本用法和功能,现在是时候学习函数…

Android应用程序架构分析和基本语法

文章目录 一、控制层与表现层二、Android程序的组成结构三、Android语法基础数据类型与转换转义字符类与对象接口 一、控制层与表现层 在Android应用程序中,逻辑控制层与表现层是分开的设计的。逻辑控制层由Java应用程序实现,表现层由XML文档描述&#…

深入探索 Cilium 的工作机制

这篇之前写 Kubernetes 网络学习之 Cilium 与 eBPF 记录的内容,隔了几个月终于想起把笔记完成,作为探索 Cilium 工作原理的入门,也还是 Cilium 冰山一角,像是高级的网络策略、网络加密、BGP 网络、服务网格等方面并没有深入。如果…

Python实现ACO蚁群优化算法优化BP神经网络回归模型(BP神经网络回归算法)项目实战

说明:这是一个机器学习实战项目(附带数据代码文档视频讲解),如需数据代码文档视频讲解可以直接到文章最后获取。 1.项目背景 蚁群优化算法(Ant Colony Optimization, ACO)是一种源于大自然生物世界的新的仿生进化算法&#xff0c…

tuple基本用法

元组简介 C11 标准新引入了一种类模板,命名为 tuple(中文可直译为元组)。tuple 最大的特点是:实例化的对象可以存储任意数量、任意类型的数据。 tuple 的应用场景很广泛,例如当需要存储多个不同类型的元素时&#xf…