# Path: gradients/subproblem.py
# def attention(Q, K, V):


from .subproblem import s, sigmoid, attention
import numpy as np

def attention_sga(x,y,a=None):
    if a == None:
        a = np.zeros(x.shape[1])
    else:
        a = np.resize(a,x.shape[1])        
    for i in range(5):
        for tau in range(x.shape[1]):

# Path: gradients/subproblem.py
# def attention(Q, K, V):


# Path: gradients/ascent.py
from .subproblem import s, sigmoid, attention
import numpy as np


def attention_sga(x,y,a=None):
    if a == None:
        a = np.zeros(x.shape[1])
    else:
        a = np.resize(a,x.shape[1])        
    for i in range(5):
        for tau in range(x.shape[1]):

            gh = abs(1-np.min(attention(np.mat(x),np.mat(y),a[tau]))) * np.gradient(x.T*a[tau],axis=0)[tau]