<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def init_weights(self, w, n=-1):
 """ This function initialises the adaptive weights of the filter. **Args:** * `w` : initial weights of filter. Possible values are: * array with initial weights (1 dimensional array) of filter size * "random" : create random weights * "zeros" : create zero value weights **Kwargs:** * `n` : size of filter (int) - number of filter coefficients. **Returns:** * `y` : output value (float) calculated from input array. """

        if n == -1:
            n = self.n
        if type(w) == str:
            if w == "random":
                w = np.random.normal(0, 0.5, n)
            elif w == "zeros":
                w = np.zeros(n)
            else:
                raise ValueError('Impossible to understand the w')
        elif len(w) == n:
            try:
                w = np.array(w, dtype="float64")
            except:
                raise ValueError('Impossible to understand the w')
        else:
            raise ValueError('Impossible to understand the w')
        self.w = w