<jupyter_start><jupyter_text>Optional: Different Actication FunctionsIt is __optional__ but recommended for you to implement these activation functions in ```exercise_code/networks/layer.py```, both forward and backward pass, as a choice of hyperparameter. __Note__: We provide you with the sigmoid activation function for your convenience, which you've already worked with in previous exercises.  Recall that activation functions introduce more non-linearity to the network. Here we introduce several kinds of activation functions:* Sigmoid$$Sigmoid(x) = \frac{1}{1 + exp(-x)}$$* ReLU$$ReLU(x) = max(0, x)$$* Leaky ReLU$$LeakyReLU(x) = max(0.01x, x)$$* Tanh$$Tanh(x) = \frac{exp(x) - exp(-x)}{exp(x) + exp(-x)}$$<jupyter_code>%load_ext autoreload
%autoreload 2
from exercise_code.tests.layer_tests import *

print(ReluTest()())
print()
print(LeakyReluTest()())
print()
print(TanhTest()())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13275299238302501, 'fraction_numerical': 0.007616974972796518, 'mean_word_length': 6.931034482758621, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '237083', 'license': 'MIT', 'n_tokens_mistral': 301, 'n_tokens_neox': 285, 'n_words': 90, 'path': 'exercise4/exercise_06/activation_functions-optional.ipynb', 'repo_name': 'UtkarshTrehan-icloud/I2DL-TUM', 'size': '919'}