fxnnxc / probe_lm

GNU General Public License v3.0
0 stars 0 forks source link

Implementation of P-pipeline for True-False Dataset (training classifiers) #3

Open fxnnxc opened 11 months ago

fxnnxc commented 11 months ago

P-pipeline framework

    1. create raw dataset 
    2. load hiddens 
    3. create probe model
    4. train the model 

The base prober is the mean pooling prober. You can implement any forward logic by inherit MLPProber

class MeanPooledMLPProber(MLPProber):
    def __init__(self, gpt_hidden_size, linear_hidden_size, linear_activation, linear_n_layers, num_outputs, **kwargs):
        super().__init__(gpt_hidden_size, linear_hidden_size, linear_activation, linear_n_layers, num_outputs, **kwargs)

    def forward(self, x):
        x = x.mean(dim=1)
        return self.net(x)
ojoo-J commented 11 months ago

231127 update

It has been updated to the youngju branch.

Arguments

+) Using the Thresholds-Method requires a way to determine the threshold value.

Probing Models

+) For debugging, default values have been specified for all arguments.

fxnnxc commented 11 months ago

The first and the last tokens are EOS tokens ([0] and [-1]). Please use [-2] to get the exact last token.

# 8 length tokens
[EOS] [EOS] [EOS] Today weather is good [EOS]
[EOS] [EOS] [EOS] [EOS] Today is good [EOS]