-
Notifications
You must be signed in to change notification settings - Fork 2
Description
It is unclear if the algorithm works in the cases in which the dimensions of the H_t
change at each time sample.
The dot product was suboptimally* implemented as one that loops in a list of elements of H_t
.
This happens in lines
DGCG_algorithm/src/operators.py
Lines 37 to 43 in 87d3d62
def H_t_product(t, f_t, g_t): | |
assert checker.is_in_H_t(t, f_t) and checker.is_in_H_t(t, g_t) | |
# Computes the H_t product at between two elements in H_t | |
# Input: t ∈ {0,1,...,T-1} | |
# f_t, g_t ∈ H_t = 1d numpy array with size K[t] | |
# Output: real value <f_t,g_t>_{H_t}. | |
return np.real(np.dot(f_t, np.conj(g_t)))/K[t] |
DGCG_algorithm/src/operators.py
Lines 55 to 64 in 87d3d62
def int_time_H_t_product(f, g): | |
assert checker.is_in_H(f) and checker.is_in_H(g) | |
# Computes ∫<f_t, g_t>_{H_t} dt | |
# Input : f,g ∈ H. | |
# Output: real number. | |
output = 0 | |
time_weights = config.time_weights | |
for t in range(config.T): | |
output += time_weights[t]*H_t_product(t, f[t], g[t]) | |
return output |
As such, it requires to build an example and then test it.
This was implemented at the beginning with the purpose of it being able to tolerate this extension, but it has not been tested
so far.
[*]: The sub-optimality happens because we have a list and we are looping on each element of it, whereas it could be faster
to take advantage of numpy
inbuilt matrix multiplication and instead recast this elements as numpy arrays and respective
multiplication.
Activity
[-]Test the algorithm to examples with non constant frequencies.[/-][+]Test the algorithm with examples with non constant frequencies.[/+]