import numpy as np
from nn.activations.activation import Activation

class Tanh(Activation):
    def __init__(self):
        def tanh(x):
            return np.tanh(x)

        def tanh_prime(x):
            return 1 - np.tanh(x) ** 2

        super().__init__(tanh, tanh_prime)

    # Modify string representation for network architecture printing
    def __str__(self):
        return self.__class__.__name__ + "()"