- 博客(18)
- 收藏
- 关注
原创 Gated channel attention的门控通道
Gated Channel Attention 是一种改进的注意力机制,通过引入门控机制来控制通道(channel)特征的选择和激活。门控通道的主要作用是增强或抑制特定通道的特征,从而使模型更好地聚焦于重要的特征,同时减少对不重要或冗余信息的依赖。Gated Channel Attention通过引入动态的门控机制,使得对每个通道的注意力权重可以根据输入数据的特征进行调整。
2024-08-20 21:26:29
384
原创 常用依赖整理
<dependencies> <!--Junit--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> <!--数据库驱动--> .
2022-02-25 17:38:25
163
原创 乱码解决方案
1.将Post方法换成Get方法2.自己手动写一个filter(弱)自己写一个filter,继承servlet的filter//并在web.xml配置<filter> <filter-name>encoding</filter-name> <filter-class>com.study.filter.EncodingFilter</filter-class> </filter>
2022-02-24 19:21:32
132
原创 Dijkstra算法(C语言实现)
Dijkstra算法用于求解单源点之间的最短路径,但是图中不能存在某条边的权为负数的回路。Dijkstra就是指定某个源点u,之后去寻找到这个源点距离最短的边(u,v),并利用这条边对其他的边进行松弛的概念,之后不断循环往复直到结束。这实际上是一个贪心的思想,但它确确实实找到的是最短路径。为什么呢?因为它每次选择的都是最短的路径,所以不可能存在还有一个点会使得源点到中转点的距离更小(因为当前路径已经是最短路径了)。还有的就是某一次松弛后并不是最短的情况,如图所示dis数组记录从源点到其他点的最短距离
2021-08-08 17:23:24
3211
原创 二叉树的先/中/后序遍历的非递归实现
//非递归的主要思想就是利用栈将三种遍历的递归函数手动实现 #include <stdio.h>#include <stdlib.h>#define M 255//二叉树 typedef struct node{ char data; struct node *lchild,*rchild;}TreeNode,*BiTree;BiTree T;//栈 typedef struct Node{ BiTree data[M]; int top;}SqStack
2021-07-28 16:55:31
156
原创 链式二叉树
#include <stdio.h>#include <stdlib.h>#define M 255typedef struct node{ char data; struct node *lchild,*rchild;}TreeNode,*BiTree;BiTree T;void visit(BiTree t){ printf("%c ",t->data);}void CreatTree(BiTree &T){ //利用先序遍历的
2021-07-23 20:49:05
80
原创 KMP算法
#include <stdio.h>#define M 255typedef struct node{ char data[M]; int length;}SString;void Init_Str(SString &str){ str.data[0]='\0'; str.length=0;} int strlen(char s[]){ int i=0; while(s[i]!='\0'){ i++; } return i+1;}void S
2021-07-21 18:27:29
79
原创 串的顺序表实现(C语言)
#include <stdio.h>#define M 255typedef struct node{ char data[M]; int length;}SString;void Init_Str(SString &str){ str.data[0]='\0'; str.length=0;} int strlen(char s[]){ //利用局部变量的返回 int i=0; while(s[i]!='\0'){ i++; } return i+
2021-07-20 16:40:36
117
原创 栈在括号匹配中的应用
#include <stdio.h>#include <string.h>#define M 50typedef struct node{ char data[M]; int top;}SqStack;void InitStack(SqStack &S){ S.top=-1;}bool StackEmpty(SqStack &S){ if(S.top==-1){ return true; } else{ return false;
2021-07-18 17:30:22
84
原创 顺序栈C语言实现
#include <stdio.h>#define M 50typedef struct node{ int data[M]; int top;}SqStack;void InitStack(SqStack &S){ S.top=-1;}bool StackEmpty(SqStack &S){ if(S.top==-1){ return true; } else{ return false; }}bool Push(SqStack &
2021-07-15 23:56:19
157
2
原创 单链表C语言实现(不带头结点)
#include <stdio.h>#include <stdlib.h>typedef struct node{ int data; struct node *next;}LNode,*LinkList;bool InitList(LinkList &L){ //不带头结点 L=NULL; return true; }LinkList List_HeadInsert(LinkList &L){
2021-07-12 23:26:06
659
2
原创 链表的实现--C语言(待续)
#include <stdio.h>#include <stdlib.h>typedef struct node{ int data; struct node *next;}LNode,*LinkList;bool InitList(LinkList &L){ L=(LNode *)malloc(sizeof(LNode)); //创建头结点 if(L==NULL){ return false; } L->next=NULL; ret
2021-07-09 23:37:30
161
3
原创 顺序表C语言实现(增删改查实现)
#include <stdio.h>#include <string.h> #include <stdlib.h>#define M 100typedef struct node{ int *data; // int data[M] 静态分配 int Maxsize; int length;}SeqList;void InitList(SeqList &L){ L.data=(int *)malloc(sizeof(int)*M);
2021-07-08 23:47:28
197
2
原创 Fabonacci数列C语言实现
#include #include <string.h>#define M 100int fi[M];int Fabonacci(int n){ //递归实现if(n1 || n2) return 1;else{return Fabonacci(n-1)+Fabonacci(n-2);}}int _Fabonacci(int n){ //非递归if(n1 || n2) return 1;else{int temp=1,temp1=1
2021-07-07 23:51:39
338
2
原创 面向对象基础
一、面向对象具有4个基本特征:1.抽象2.封装3.继承4.多态抽象(abstract)抽象是指有意“忽略”问题的某些细节和与当前目标无关的方面,以便把问题的本质表达得更清楚。封装(encapsulation)将数据和与这个数据有关的操作集合在一起,形成一个实体——对象,且尽可能隐藏对象的内部细节。特点:封装的单位是对象,封装具有边界,利用接口实现与外界的链接。该图体现了抽象和封装,用户可见的那些特性便是抽象出来的,而函数内部的具体实现便是对对象的封装。继承(inherit)继承是对
2020-08-07 17:09:01
254
原创 走迷宫求最短路径问题
走迷宫求最短路径问题有一个迷宫,有08行和08列: 1,1,1,1,1,1,1,1,1 1,0,0,1,0,0,1,0,1 1,0,0,1,1,0,0,0,1 1,0,1,0,1,1,0,1,1 1,0,0,0,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,1,0,0,1 1,1,0,1,0,0,0,0,1 1,1,1,1,1,1,1,1,1 0表示道路,1表示墙。 现在输入一个
2020-05-23 22:44:40
1193
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人