<commit_before>require 'nn'

local function alexnet_model()
   
    local alexnet = nn.Sequential()

    -- WE GIVE YOU THE FIRST MODULE FOR THIS ALEXNET-LIKE FRAMEWORK
    -- YOU NEED TO IMPLEMENT THE REST OF THE NETWORK
    -- NOT ALL MODULES HAVE TRAINABLE PARAMETERS
    -- ADD THE w_lr (weight learning rate) and b_lr (bias learning rate)
    -- ONLY TO THE MODULES THAT HAVE TRAINABLE PARAMETERS

    -- IN MANY IMPLEMENTATIONS YOU WILL SEE THAT ONE STRICTLY ONLY NEEDS TO 
    -- DEFINE THE MODULE AND ITS INITIAL PARAMETERS
    mod = nn.SpatialConvolution(3, 96, 5, 5, 1, 1, 2, 2)
    -- IN MANY IMPLEMENTATIONS YOU WILL SEE THAT ONE STRICTLY ONLY NEEDS TO 
    -- DEFINE THE MODULE AND ITS INITIAL PARAMETERS. FOR OUR CONVENIENCE WE
    -- CAN INCLUDE FURTHER HELPER VARIABLES THAT PERHAPS WE ARE GOING TO USE NEXT
    
    -- ONE SUCH HELPER VARIABLE IS AN ID/NAME FOR THE MODULE.
    -- WE CAN ASSIGN DIFFERENT NAMES TO MODULES, SO THAT WE CAN DO OUR
    -- ANALYSIS OR DEBUGGING EASIER. E.G. WE MIGHT WANT TO EXCLUDE A SPECIFIC
    -- LAYER WHEN INITIALIZING A NEW LAYER WITH THE WEIGHTS OF AN EXISTING,
    -- PRETRAINED NETWORK

    -- ANOTHER SUCH VARIABLE ARE MODULE LEARNING RATES. IN TORCH YOU CANNOT
    -- EXPLICITLY DEFINE A LEARNING RATE PER MODULE. INSTEAD, YOU CAN DEFINE
    -- A LEARNING RATE VECTOR FOR THE WHOLE VECTOR, WHERE EACH DIMENSION REFERS
    -- TO EACH OF THE PARAMETERS OF THE NETWORK (AS OBTAINED FROM THE FUNCTION 
    -- params, grad_params = model:getParameters()). HENCE, HERE WE CAN DEFINE
    -- A VARIABLE WITH THE INITIAL LEARNING RATE OF THE MODULE. THEN THE LEARNING
    -- RATE SCHEDULE OF THE OPTIMIZATION FUNCTION TAKES CARE OF THE REST.

    -- YOU CAN ADD MORE MODULE HELPER VARIABLES, IF THEY HELP YOU WITH THE 
    -- NETWORK DEFINITION AND TRAINING

    mod.id   = 'conv1'
    mod.w_lr = -- THIS VARIABLE CAN BE COMMENTED OUT IF A UNIQUE LEARNING RATE IS USED FOR THE WHOLE NETWORK
    mod.b_lr = -- THIS VARIABLE CAN BE COMMENTED OUT IF A UNIQUE LEARNING RATE IS USED FOR THE WHOLE NETWORK
    alexnet:add(mod)

    -- TODO

    return alexnet<commit_msg>Small update<commit_after>require 'nn'

local function alexnet_model()
   
    local alexnet = nn.Sequential()

    -- WE GIVE YOU THE FIRST MODULE FOR THIS ALEXNET-LIKE FRAMEWORK
    -- YOU NEED TO IMPLEMENT THE REST OF THE NETWORK
    -- NOT ALL MODULES HAVE TRAINABLE PARAMETERS
    -- ADD THE w_lr (weight learning rate) and b_lr (bias learning rate)
    -- ONLY TO THE MODULES THAT HAVE TRAINABLE PARAMETERS

    -- IN MANY IMPLEMENTATIONS YOU WILL SEE THAT ONE STRICTLY ONLY NEEDS TO 
    -- DEFINE THE MODULE AND ITS INITIAL PARAMETERS
    mod = nn.SpatialConvolution(3, 96, 5, 5, 1, 1, XX, XX)
    -- IN MANY IMPLEMENTATIONS YOU WILL SEE THAT ONE STRICTLY ONLY NEEDS TO 
    -- DEFINE THE MODULE AND ITS INITIAL PARAMETERS. FOR OUR CONVENIENCE WE
    -- CAN INCLUDE FURTHER HELPER VARIABLES THAT PERHAPS WE ARE GOING TO USE NEXT
    
    -- ONE SUCH HELPER VARIABLE IS AN ID/NAME FOR THE MODULE.
    -- WE CAN ASSIGN DIFFERENT NAMES TO MODULES, SO THAT WE CAN DO OUR
    -- ANALYSIS OR DEBUGGING EASIER. E.G. WE MIGHT WANT TO EXCLUDE A SPECIFIC
    -- LAYER WHEN INITIALIZING A NEW LAYER WITH THE WEIGHTS OF AN EXISTING,
    -- PRETRAINED NETWORK

    -- ANOTHER SUCH VARIABLE ARE MODULE LEARNING RATES. IN TORCH YOU CANNOT
    -- EXPLICITLY DEFINE A LEARNING RATE PER MODULE. INSTEAD, YOU CAN DEFINE
    -- A LEARNING RATE VECTOR FOR THE WHOLE VECTOR, WHERE EACH DIMENSION REFERS
    -- TO EACH OF THE PARAMETERS OF THE NETWORK (AS OBTAINED FROM THE FUNCTION 
    -- params, grad_params = model:getParameters()). HENCE, HERE WE CAN DEFINE
    -- A VARIABLE WITH THE INITIAL LEARNING RATE OF THE MODULE. THEN THE LEARNING
    -- RATE SCHEDULE OF THE OPTIMIZATION FUNCTION TAKES CARE OF THE REST.

    -- YOU CAN ADD MORE MODULE HELPER VARIABLES, IF THEY HELP YOU WITH THE 
    -- NETWORK DEFINITION AND TRAINING

    mod.id   = 'conv1'
    mod.w_lr = -- THIS VARIABLE CAN BE COMMENTED OUT IF A UNIQUE LEARNING RATE IS USED FOR THE WHOLE NETWORK
    mod.b_lr = -- THIS VARIABLE CAN BE COMMENTED OUT IF A UNIQUE LEARNING RATE IS USED FOR THE WHOLE NETWORK
    alexnet:add(mod)

    -- TODO

    return alexnet
{'fraction_non_alphanumeric': 0.05485930480018917, 'fraction_numerical': 0.00425632537242847, 'mean_word_length': 2.7903225806451615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2365303', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1411, 'n_words': 608}