Skip to content

Commit

Permalink
Minor in TSR
Browse files Browse the repository at this point in the history
  • Loading branch information
JHoelli committed Feb 28, 2024
1 parent 3b7288f commit 3af5311
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ def _getTwoStepRescaling(
inputGrad = np.zeros((input_size, 1))
newGrad = np.zeros((input_size, sequence_length))

if self.mode == "time":
newGrad = np.swapaxes(newGrad, -1, -2)
#if self.mode == "time":
# newGrad = np.swapaxes(newGrad, -1, -2)


if hasBaseline is None:
Expand Down Expand Up @@ -350,8 +350,10 @@ def _getTwoStepRescaling(
timeContribution = preprocessing.minmax_scale(timeGrad, axis=1)

meanTime = np.quantile(timeContribution, 0.55)

if input_size>1:
for t in range(sequence_length):
print('TIME CONR',timeContribution[0, t])
if timeContribution[0, t] > meanTime:
for c in range(input_size):
newInput = input.clone()
Expand Down Expand Up @@ -410,11 +412,11 @@ def _getTwoStepRescaling(

else:
featureContribution = np.ones((input_size, 1)) * 0.1


if self.mode == "time":
newGrad = np.swapaxes(newGrad, -1, -2)
for c in range(input_size):
newGrad[c, t] = timeContribution[0, t] * featureContribution[c, 0]

else:
newGrad=timeContribution

Expand Down

0 comments on commit 3af5311

Please sign in to comment.