This exercise has two parts. First you shall implement implement a FFNN from scratch, coding both the forward and backward pass using matrix multiplications, and next update this code to implement the NNAlign forward pass with insertions and deletions for peptides which are not 9-mers.
First you must access the program templates and exercise data
Download the file
NNDeep_FFNN_2025.tar.gz.
Open the file (using tar -xzvf NNDeep_FFNN.tar.gz) and place the created NNDeep directory in the "Algo/code" directory.
Now the NNDeep directory should contain the Jupyter-Notebook file
FFNN_from_scratch.ipynb
Next, download the data file
NNdeep_data.tar.gz.
Place the file in the course data direcory, and open the file (using tar -xzvf NNdeep_data.tar.gz). The created NNDeep directory should now contain the following files and directories
BLOSUM50 A0201/ A0301/
Now we are ready to code
Open the FFNN_from_scratch.ipynb notebook and implement the feed-forward neural network part. You shall fill in the missing code (find the place with the missing code (XXXX)).
In details you shall, for a one hidden layer feed-forward neural network, with weights and biases:
What can you tell from the error curves for the training and validation dataset?
Is your model training properly?
Test the code by selecting some allele data and running the notebooks.
Test different hyperparameters (hidden_size, learning_rate, n_epochs, etc) and plot the various results you get and compare their AUC values (larger = better).
After you have succesfully implemented the neural network, make the notebook into two python scripts:
To ensure that all your hard work has paid off, try to run the training script using the same hyperparameter configuration and training data you used in the first neural network exercise NN exercise
Is the error more or less the same for the new and the old model? How much faster is the new model?
Now you are done with the FFNN exercise. Remember to upload python programs via DTU-Inside
This exercise will be following the FFNN exercise closely.
We will
First download the code
NNAlign_from_scratch.ipynb.
and place it in the NNDeep directory in the "Algo/code" directory.
Your task is to first fill in the missing code in the forward function of the NNAlignFFNN class (find the place with the missing code (XXXX)).
Try training an NNAlign model with the same hyperparameters as the FFNN model from before.
After you have succesfully implemented the NNAlign method, make the notebook into two python scripts:
The scripts you have developed here are modular and can be used for various purposes, such as cross-validation and hyperparameter tuning. You have already implemented some wrapper scripts for this during the SMM exercise SMM exercise .
Now you are done. Remember to upload python programs via DTU-Inside