1.1.3. svGPFA.stats package#
1.1.3.1. Submodules#
1.1.3.2. svGPFA.stats.expectedLogLikelihood module#
- class svGPFA.stats.expectedLogLikelihood.ExpectedLogLikelihood(svEmbeddingAllTimes, linkFunction)[source]#
Bases:
ABC
- class svGPFA.stats.expectedLogLikelihood.PointProcessELL(svEmbeddingAllTimes, svEmbeddingAssocTimes, linkFunction)[source]#
Bases:
ExpectedLogLikelihood
- class svGPFA.stats.expectedLogLikelihood.PointProcessELLExpLink(svEmbeddingAllTimes, svEmbeddingAssocTimes)[source]#
Bases:
PointProcessELL
- class svGPFA.stats.expectedLogLikelihood.PointProcessELLQuad(svEmbeddingAllTimes, svEmbeddingAssocTimes, linkFunction)[source]#
Bases:
PointProcessELL
- class svGPFA.stats.expectedLogLikelihood.PoissonELL(svEmbeddingAllTimes, linkFunction)[source]#
Bases:
ExpectedLogLikelihood
- class svGPFA.stats.expectedLogLikelihood.PoissonELLExpLink(svEmbeddingAllTimes)[source]#
Bases:
PoissonELL
- class svGPFA.stats.expectedLogLikelihood.PoissonELLQuad(svEmbeddingAllTimes, linkFunction)[source]#
Bases:
PoissonELL
1.1.3.3. svGPFA.stats.kernels module#
- class svGPFA.stats.kernels.ExponentialQuadraticKernel(scale=1.0, lengthscaleScale=1.0, dtype=torch.float64)[source]#
Bases:
Kernel
1.1.3.4. svGPFA.stats.kernelsMatricesStore module#
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsAndAllTimesKMS[source]#
Bases:
IndPointsLocsAndTimesKMS
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsAndAssocTimesKMS[source]#
Bases:
IndPointsLocsAndTimesKMS
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsAndTimesKMS[source]#
Bases:
KernelsMatricesStore
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsKMS[source]#
Bases:
KernelsMatricesStore
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsKMS_Chol[source]#
Bases:
IndPointsLocsKMS
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsKMS_CholWithGettersAndSetters[source]#
Bases:
IndPointsLocsKMS_Chol
,KernelMatricesStoreGettersAndSetters
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsKMS_PInv[source]#
Bases:
IndPointsLocsKMS
- class svGPFA.stats.kernelsMatricesStore.IndPointsLocsKMS_PInvWithGettersAndSetters[source]#
Bases:
IndPointsLocsKMS_PInv
,KernelMatricesStoreGettersAndSetters
1.1.3.5. svGPFA.stats.klDivergence module#
1.1.3.6. svGPFA.stats.svEM module#
- class svGPFA.stats.svEM.ErrorTerminationInfo(message, error, stack_trace)[source]#
Bases:
TerminationInfo
- property error#
- property stack_trace#
- class svGPFA.stats.svEM.SVEM[source]#
Bases:
ABC
- abstract maximize(model, optim_params, method='ECM', getIterationModelParamsFn=None, printIterationModelParams=True, logLock=None, logStreamFN=None, lowerBoundLock=None, lowerBoundStreamFN=None, latentsTimes=None, latentsLock=None, latentsStreamFN=None, verbose=True, out=<sphinx_gallery.gen_rst._LoggingTee object>, savePartial=False, savePartialFilenamePattern='results/00000000_{:s}_estimatedModel.pickle')[source]#
Maximizes the sparse variational lower bound, Eq. 4 in Duncker and Sahani, 2018.
Note
Only parameters model, optim_params and method should be set by users. The remaining parameters are used to interface
svGPFA.stats.svEM.SVEM.maximize()
with the dashboard.- Parameters:
model (
svGPFA.stats.svLowerBound.SVLowerBound
) – svGPFA model used to calculate the lower boundoptim_params (dictionary) – optimization parameters. The format of this dictionary is identical to the one described in Optimisation parameters. It can be obtained at the key
optim_params
of the dictionary returned bysvGPFA.utils.initUtils.getParamsAndKernelsTypes()
.method – either ECM for Expectation Conditional Maximization or mECM for multicycle expectation conditional maximization. Refer to McLachlan and Krishnan [MK08] for details on these algorithms.
- class svGPFA.stats.svEM.SVEM_PyTorch[source]#
Bases:
SVEM
- maximize(model, optim_params, method='ECM', getIterationModelParamsFn=None, printIterationModelParams=True, logLock=None, logStreamFN=None, lowerBoundLock=None, lowerBoundStreamFN=None, latentsTimes=None, latentsLock=None, latentsStreamFN=None, verbose=True, out=<sphinx_gallery.gen_rst._LoggingTee object>, savePartial=False, savePartialFilenamePattern='results/00000000_{:s}_estimatedModel.pickle')[source]#
Maximizes the sparse variational lower bound, Eq. 4 in Duncker and Sahani, 2018.
Note
Only parameters model, optim_params and method should be set by users. The remaining parameters are used to interface
svGPFA.stats.svEM.SVEM.maximize()
with the dashboard.- Parameters:
model (
svGPFA.stats.svLowerBound.SVLowerBound
) – svGPFA model used to calculate the lower boundoptim_params (dictionary) – optimization parameters. The format of this dictionary is identical to the one described in Optimisation parameters. It can be obtained at the key
optim_params
of the dictionary returned bysvGPFA.utils.initUtils.getParamsAndKernelsTypes()
.method – either ECM for Expectation Conditional Maximization or mECM for multicycle expectation conditional maximization. Refer to McLachlan and Krishnan [MK08] for details on these algorithms.
- class svGPFA.stats.svEM.SVEM_SciPy[source]#
Bases:
SVEM
- maximize(model, optim_params, method='EM', getIterationModelParamsFn=None, printIterationModelParams=True, logLock=None, logStreamFN=None, lowerBoundLock=None, lowerBoundStreamFN=None, latentsTimes=None, latentsLock=None, latentsStreamFN=None, verbose=True, out=<sphinx_gallery.gen_rst._LoggingTee object>, savePartial=False, savePartialFilenamePattern='00000000_{:s}_estimatedModel.pickle')[source]#
Maximizes the sparse variational lower bound, Eq. 4 in Duncker and Sahani, 2018.
Note
Only parameters model, optim_params and method should be set by users. The remaining parameters are used to interface
svGPFA.stats.svEM.SVEM.maximize()
with the dashboard.- Parameters:
model (
svGPFA.stats.svLowerBound.SVLowerBound
) – svGPFA model used to calculate the lower boundoptim_params (dictionary) – optimization parameters. The format of this dictionary is identical to the one described in Optimisation parameters. It can be obtained at the key
optim_params
of the dictionary returned bysvGPFA.utils.initUtils.getParamsAndKernelsTypes()
.method – either ECM for Expectation Conditional Maximization or mECM for multicycle expectation conditional maximization. Refer to McLachlan and Krishnan [MK08] for details on these algorithms.
1.1.3.7. svGPFA.stats.svEmbedding module#
- class svGPFA.stats.svEmbedding.LinearSVEmbedding(svPosteriorOnLatents)[source]#
Bases:
SVEmbedding
- class svGPFA.stats.svEmbedding.LinearSVEmbeddingAllTimes(svPosteriorOnLatents)[source]#
Bases:
LinearSVEmbedding
- class svGPFA.stats.svEmbedding.LinearSVEmbeddingAllTimesWithParamsGettersAndSetters(svPosteriorOnLatents)[source]#
Bases:
LinearSVEmbeddingAllTimes
- class svGPFA.stats.svEmbedding.LinearSVEmbeddingAssocTimes(svPosteriorOnLatents)[source]#
Bases:
LinearSVEmbedding
1.1.3.8. svGPFA.stats.svGPFAModelFactory module#
- svGPFA.stats.svGPFAModelFactory.ExponentialLink = 1000#
- svGPFA.stats.svGPFAModelFactory.Gaussian = 2#
- svGPFA.stats.svGPFAModelFactory.LinearEmbedding = 100#
- svGPFA.stats.svGPFAModelFactory.NonExponentialLink = 1001#
- svGPFA.stats.svGPFAModelFactory.PointProcess = 0#
- svGPFA.stats.svGPFAModelFactory.Poisson = 1#
- class svGPFA.stats.svGPFAModelFactory.SVGPFAModelFactory[source]#
Bases:
object
- static buildModelPyTorch(kernels, conditionalDist=0, linkFunction=1000, embeddingType=100, kernelMatrixInvMethod=10000, indPointsCovRep=100001)[source]#
Creates an svGPFA model.
svGPFA.stats.svLowerBound.SVLowerBound.setInitialDataAndParams()
should be invoked before using the created model as argument tosvGPFA.stats.svEM.SVEM.maximize()
.- Parameters:
kernels (list of instances from subclass of (
svGPFA.stats.kernel.Kernel
)) – list of kernels (svGPFA.stats.kernel
) to be used in the modelconditionalDist (int) – likelihood distribution (e.g., svGPFA.stats.SVGPFAModelFactory.PointProcess or svGPFA.stats.SVGPFAModelFactory.Gaussian)
embeddingType (int) – type of embedding (e.g., svGPFA.stats.SVGPFAModelFactory.LinearEmbedding)
- Returns:
an unitialized model. Parameters and data need to be set (by calling
svGPFA.stats.svLowerBound.SVLowerBound.setParamsAndData()
) before invokingsvGPFA.stats.svEM.SVEM.maximize()
.- Return type:
an instance of
svGPFA.stats.svLowerBound.SVLowerBound
.
- svGPFA.stats.svGPFAModelFactory.indPointsCovChol = 100001#
- svGPFA.stats.svGPFAModelFactory.indPointsCovRank1PlusDiag = 100000#
- svGPFA.stats.svGPFAModelFactory.kernelMatrixInvChol = 10000#
- svGPFA.stats.svGPFAModelFactory.kernelMatrixInvPInv = 10001#
1.1.3.9. svGPFA.stats.svLBFGS module#
- class svGPFA.stats.svLBFGS.ErrorTerminationInfo(message, error)[source]#
Bases:
TerminationInfo
- property error#
- class svGPFA.stats.svLBFGS.SVLBFGS[source]#
Bases:
object
- maximize(model, optimParams, method='EM', getIterationModelParamsFn=None, logLock=None, logStreamFN=None, lowerBoundLock=None, lowerBoundStreamFN=None, latentsTimes=None, latentsLock=None, latentsStreamFN=None, verbose=True, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>, savePartial=False, savePartialFilenamePattern='00000000_{:s}_estimatedModel.pickle')[source]#
1.1.3.10. svGPFA.stats.svLowerBound module#
- class svGPFA.stats.svLowerBound.SVLowerBound(eLL, klDiv)[source]#
Bases:
object
- setParamsAndData(measurements, initial_params, eLLCalculationParams, priorCovRegParam)[source]#
Sets model parameters and data.
- Parameters:
measurements (nested list) –
measurements[r][n]
are the measurements for trialr
and neuronn
.For a point-process SVLowerBound (i.e., for a SVLowerBound constructed with an expected log-likelihood of class
svGPFA.stats.expectedLogLikelihood.PointProcessELL
)measurements[r][n]
should be a list of spikes times for trialr
and neuronn
.For a Poisson SVLowerBound (i.e., for a SVLowerBound constructed with an expected log-likelihood of class
svGPFA.stats.expectedLogLikelihood.PoissonELL
)measurements[r][n]
should be a tuple of lengthn_bins
containing the spike counts in bins.initial_params (dictionary) – initial parameters as returned by
svGPFA.utils.initUtils.getParamsAndKernelsTypes()
.eLLCalculationParams (dictionary) –
parameters used to calculate the expected log likelighood.
For a point-process SVLowerBound
eLLCalculationParams
should be a dictionary with keysleg_quad_points
andleg_quad_points
, containing the Legendre quadrature points and weights, respectivey, used to calculate the integral of the expected log likelihood (Eq. 7 in Duncker and Sahani [DS18]).For a Poisson SVLowerBound
eLLCalculationParams
should be a dictionary with keybinTimes
containing the mean time of every bin.priorCovRegParam (float) – regularization parameter for the prior covariance matrix (\(K_{zz}\) in Eq. 2 of Duncker and Sahani [DS18]).
- class svGPFA.stats.svLowerBound.SVLowerBoundWithParamsGettersAndSetters(eLL, klDiv)[source]#
Bases:
SVLowerBound
1.1.3.11. svGPFA.stats.svPosteriorOnIndPoints module#
- class svGPFA.stats.svPosteriorOnIndPoints.SVPosteriorOnIndPointsChol[source]#
Bases:
SVPosteriorOnIndPoints
- class svGPFA.stats.svPosteriorOnIndPoints.SVPosteriorOnIndPointsCholWithGettersAndSetters[source]#
Bases:
SVPosteriorOnIndPointsChol
1.1.3.12. svGPFA.stats.svPosteriorOnLatents module#
- class svGPFA.stats.svPosteriorOnLatents.SVPosteriorOnLatents(svPosteriorOnIndPoints, indPointsLocsKMS, indPointsLocsAndTimesKMS)[source]#
Bases:
ABC
- class svGPFA.stats.svPosteriorOnLatents.SVPosteriorOnLatentsAllTimes(svPosteriorOnIndPoints, indPointsLocsKMS, indPointsLocsAndTimesKMS)[source]#
Bases:
SVPosteriorOnLatents
- class svGPFA.stats.svPosteriorOnLatents.SVPosteriorOnLatentsAssocTimes(svPosteriorOnIndPoints, indPointsLocsKMS, indPointsLocsAndTimesKMS)[source]#
Bases:
SVPosteriorOnLatents