<jupyter_start><jupyter_text>InstructionsBuild a whale recognizer deep learing model in PyTorch.Your model takes as an input X tensor and outputs predictions for the whale id.Read more about pytorch and model definition in the following resources:https://towardsdatascience.com/pytorch-tutorial-distilled-95ce8781a89c?gi=ef974c787a5ehttp://pytorch.org/tutorials/beginner/deep_learning_60min_blitz.htmlNow the architecture that you need is the following:Apart from whale id this model also uses auxilary targets. It helps with training and serves the purpose of regularization. The auxilary outputs is the callosity pattern. You can read about it on our bloghttps://blog.deepsense.ai/deep-learning-right-whale-recognition-kaggle/and investigate `metadata.csv` to look at those target columns.  Your SolutionYour solution function should be called solution. CONFIG is a dictionary with all parameters that you want to pass to your solution function<jupyter_code>import torch.nn as nn
CONFIG = {'input_size':(3, 256, 256),
         'classes':{'points':128,
                    'callosity':3 ,
                    'whale_id':447}
         }

def solution(input_shape, classes):
    class PyTorchClassifier(nn.Module):
        def __init__(self, input_shape, classes):
            """
            input_shape: tuple representing shape
            classes: dictionary of ints with keys ['points','callosity','whale_id']
            """
            super(PyTorchClassifier, self).__init__()
            self.features = nn.Sequential(
               
                # Feature extraction part of the neural network.
                # Stack those layers to get architecture defined in the notes above.
            )
            
            self.flat_features_nr = self._get_flat_features_nr(input_shape, self.features)

            self.whale_id = nn.Sequential(
                # Put your classification layers for whale id.
            )
            
            self.callosity = nn.Sequential(
                # Put your classification layers for callosity.
            )

        def _get_flat_features_nr(self, in_size, features):
            
            # Linear layers need to know what is the size of the input.
            # Implement a function that returns the size of flattened features.
            
            return flattened_features_size

        def forward(self, x):
            
            # Implement forward pass through the network.
            
            return [pred_whale_id, pred_callosity]

        def forward_target(self, x):
            
            # We want to forget about the auxilary outputs here and only output the target predictions.
            
            return [pred_whale_id]
    
    return PyTorchClassifier(input_shape, classes)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06278986799857296, 'fraction_numerical': 0.011059579022475919, 'mean_word_length': 2.354066985645933, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '149816', 'license': 'MIT', 'n_tokens_mistral': 744, 'n_tokens_neox': 705, 'n_words': 242, 'path': 'resources/whales/tasks/task3.ipynb', 'repo_name': 'minerva-ml/minerva-training-materials', 'size': '2803'}