mirror of https://github.com/jlizier/jidt
Adding a field to the object returned from local TE for spike trains which holds the ISI to previous (selected) source spike
This commit is contained in:
parent
cab3de8b07
commit
283dcb3b94
|
|
@ -103,6 +103,9 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr
|
|||
protected KdTree kdTreeConditioningAtSpikes = null;
|
||||
protected KdTree kdTreeConditioningAtSamples = null;
|
||||
|
||||
// Cache these to return with the local values:
|
||||
protected double[] timeToPreviousRelevantSourceSpikes;
|
||||
|
||||
public static final String KNNS_PROP_NAME = "Knns";
|
||||
|
||||
/**
|
||||
|
|
@ -417,6 +420,7 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr
|
|||
|
||||
|
||||
// Convert the vectors to arrays so that they can be put in the trees
|
||||
// Embeddings from target spikes:
|
||||
double[][] arrayedTargetEmbeddingsFromSpikes = new double[conditioningEmbeddingsFromSpikes.size()][numDestPastIntervals + numCondPastIntervals];
|
||||
double[][] arrayedJointEmbeddingsFromSpikes = new double[conditioningEmbeddingsFromSpikes.size()][numDestPastIntervals +
|
||||
numCondPastIntervals + numSourcePastIntervals];
|
||||
|
|
@ -424,6 +428,9 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr
|
|||
arrayedTargetEmbeddingsFromSpikes[i] = conditioningEmbeddingsFromSpikes.elementAt(i);
|
||||
arrayedJointEmbeddingsFromSpikes[i] = jointEmbeddingsFromSpikes.elementAt(i);
|
||||
}
|
||||
// Store locally the lag times from most recent relevant source spike for each target spike, for later return with locals:
|
||||
timeToPreviousRelevantSourceSpikes = MatrixUtils.selectColumn(arrayedJointEmbeddingsFromSpikes, numDestPastIntervals + numCondPastIntervals);
|
||||
// Sample points:
|
||||
double[][] arrayedTargetEmbeddingsFromSamples = new double[conditioningEmbeddingsFromSamples.size()][numDestPastIntervals + numCondPastIntervals];
|
||||
double[][] arrayedJointEmbeddingsFromSamples = new double[conditioningEmbeddingsFromSamples.size()][numDestPastIntervals +
|
||||
numCondPastIntervals + numSourcePastIntervals];
|
||||
|
|
@ -966,9 +973,14 @@ public class TransferEntropyCalculatorSpikingIntegration implements TransferEntr
|
|||
// Data structure to return local values from this estimator
|
||||
public class SpikingTELocalValues implements SpikingLocalInformationValues {
|
||||
public double[] contributionsAtEachSpike;
|
||||
public double[] timeToMostRecentSourceSpike;
|
||||
|
||||
public SpikingTELocalValues(double[] contributionsAtEachSpike) {
|
||||
this.contributionsAtEachSpike = contributionsAtEachSpike;
|
||||
int numTargetSpikesToSkip = MatrixUtils.max(destPastIntervals);
|
||||
this.timeToMostRecentSourceSpike = new double[numTargetSpikesToSkip + timeToPreviousRelevantSourceSpikes.length];
|
||||
System.arraycopy(timeToPreviousRelevantSourceSpikes, 0, this.timeToMostRecentSourceSpike, numTargetSpikesToSkip,
|
||||
timeToPreviousRelevantSourceSpikes.length);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue