KataGo icon indicating copy to clipboard operation
KataGo copied to clipboard

Integrating attention and feature vectors?

Open Centaurea-Platinum opened this issue 6 months ago • 2 comments

I want to train my own net and make some additions onto the katago framework. Using my very limited AI knowledge, I theorized that a 2d pos encoded attention layer could perhaps reduce the need for deep nets and training costs on learning global relationships? Furthermore, could returning and updating feature vectors in the MCTS allow for better propagation of data in the tree and thus better game play?

For instance in the following framework: Evaluation Input[m,n,3]: ToPlay(full plane of 0,1) + illegal move mask(0,1) + current board state(-1, 0, 1) Input[r]: Specific rules(binary encoded: AreaTerritory, SekiScoring, TaxRule,...) and komi Output[m,n,3]: probability that a certain position is the best move, force positions on illegal move mask to be 0 + expected winrate + probability ownership of position is black NeuralNet Pad input [m+1,n+1,3] input through resnet, transform into [m+1,n+1,1024] stack of feature map [m+1,n+1,1024] stack of feature maps through stacked layers of multi head attention [m+1,n+1,1024] through multi head attention pool into [1024] [r] set of rules and komi into [1024] vector through MLP use the two [1024] vector as weight for the feature map, multiplying each feature map with its two corresponding weights(late fusion of specifications) resnet, decrease dimensions of feature map from [m+1,n+1,1024] into [m+1,n+1,256] use multi head attention pooling to combine the [m+1,n+1,256] tensor into a [256] vector to return for the MCTS tree resnet, decrease [m+1,n+1,256] further into the output of [m,n,3], spatial dimensions is transformed in the last convolution layer by not padding

MCTS Assign weights based on best move prob + noise, implement force playout returns the [256] vector to update the [m+1,n+1,256] tensor at the corresponding position

Centaurea-Platinum avatar Jul 03 '25 12:07 Centaurea-Platinum