1.1.4. svGPFA.utils package#

1.1.4.1. Submodules#

1.1.4.2. svGPFA.utils.configUtils module#

svGPFA.utils.configUtils.getIndPointsMeans(nTrials, nLatents, config)[source]#
svGPFA.utils.configUtils.getKernels(nLatents, config, forceUnitScale)[source]#
svGPFA.utils.configUtils.getLatentsMeansFuncs(nLatents, nTrials, config)[source]#
svGPFA.utils.configUtils.getScaledKernels(nLatents, config, forceUnitScale)[source]#
svGPFA.utils.configUtils.getVariationalMean0FromList(nLatents, nTrials, config)[source]#

1.1.4.3. svGPFA.utils.initUtils module#

svGPFA.utils.initUtils.buildEquidistantIndPointsLocs0(n_latents, n_trials, n_ind_points, trials_start_times, trials_end_times)[source]#
svGPFA.utils.initUtils.buildFloatListFromStringRep(stringRep)[source]#
svGPFA.utils.initUtils.buildUniformIndPointsLocs0(n_latents, n_trials, n_ind_points, trials_start_times, trials_end_times)[source]#
svGPFA.utils.initUtils.flatToHierarchicalOptimParams(flat_optim_params)[source]#
svGPFA.utils.initUtils.getArgsInfo()[source]#
svGPFA.utils.initUtils.getConstantIndPointsMeans(constantValue, n_trials, n_latents, nIndPointsPerLatent)[source]#
svGPFA.utils.initUtils.getDefaultParamsDict(n_neurons, n_trials, n_latents=3, n_ind_points=None, common_n_ind_points=10, n_quad=200, diag_var_cov0_value=0.01, prior_cov_reg_param=0.001, lengthscale=1.0, em_max_iter=50)[source]#
svGPFA.utils.initUtils.getDiffAcrossLatentsAndTrialsIndPointsLocs0(n_latents, n_trials, params_dict, params_dict_type, section_name='ind_points_locs_params0', item_name_pattern='ind_points_locs0_filename_latent{:d}_trial{:d}', delimiter=',')[source]#
svGPFA.utils.initUtils.getDiffAcrossLatentsAndTrialsVariationalCov0(n_latents, n_trials, params_dict, params_dict_type, section_name='variational_params0', item_name_pattern='variational_cov0_filename_latent{:d}_trial{:d}', delimiter=',')[source]#
svGPFA.utils.initUtils.getDiffAcrossLatentsAndTrialsVariationalMean0(n_latents, n_trials, params_dict, params_dict_type, section_name='variational_params0', item_name_pattern='variational_mean_latent{:d}_trial{:d}_filename', delimiter=',')[source]#
svGPFA.utils.initUtils.getIndPointsLocs0(n_latents, n_trials, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None, n_ind_points=None, trials_start_times=None, trials_end_times=None)[source]#
svGPFA.utils.initUtils.getIndPointsLocs0InDict(n_latents, n_trials, params_dict, params_dict_type, n_ind_points, trials_start_times, trials_end_times, section_name='ind_points_locs_params0')[source]#
svGPFA.utils.initUtils.getKernelsParams0(kernels, noiseSTD)[source]#
svGPFA.utils.initUtils.getKernelsParams0AndTypes(n_latents, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None)[source]#
svGPFA.utils.initUtils.getKernelsParams0AndTypesInDict(n_latents, params_dict, params_dict_type, section_name='kernels_params0')[source]#
svGPFA.utils.initUtils.getKernelsScaledParams0(kernels, noiseSTD)[source]#
svGPFA.utils.initUtils.getKzzChol0(kernels, kernelsParams0, ind_points_locs0, epsilon)[source]#
svGPFA.utils.initUtils.getLinearEmbeddingParam0(param_label, n_rows, n_cols, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None)[source]#
svGPFA.utils.initUtils.getLinearEmbeddingParam0InDict(param_label, params_dict, params_dict_type, n_rows, n_cols, section_name='embedding_params0', delimiter=',')[source]#
svGPFA.utils.initUtils.getLinearEmbeddingParams0(n_neurons, n_latents, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None)[source]#
svGPFA.utils.initUtils.getOptimParams(dynamic_params_spec, config_file_params_spec, default_params_spec=None, optim_params_info=None, section_name='optim_params')[source]#
svGPFA.utils.initUtils.getParam(section_name, param_name, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None)[source]#
svGPFA.utils.initUtils.getParamsAndKernelsTypes(n_neurons, n_trials, n_latents, trials_start_times, trials_end_times, default_params_spec=None, config_file_params_spec=None, dynamic_params_spec=None)[source]#

Builds initial, expected log likelihood and optimization parameters, as well as kernels types, from specifications given in default_params_spec, config_file_params_spec and dynamic_params_spec.

Parameters:
svGPFA.utils.initUtils.getParamsDictFromArgs(n_latents, n_trials, args, args_info)[source]#
svGPFA.utils.initUtils.getParamsDictFromStringsDict(n_latents, n_trials, strings_dict, args_info)[source]#
svGPFA.utils.initUtils.getSVPosteriorOnIndPointsParams0(nIndPointsPerLatent, n_latents, n_trials, scale)[source]#
svGPFA.utils.initUtils.getSameAcrossLatentsAndTrialsIndPointsLocs0(n_latents, n_trials, ind_points_locs0_filename, delimiter=',')[source]#
svGPFA.utils.initUtils.getSameAcrossLatentsAndTrialsVariationalCov0(n_latents, n_trials, a_variational_cov0, section_name='variational_params0')[source]#
svGPFA.utils.initUtils.getSameAcrossLatentsAndTrialsVariationalMean0(n_latents, n_trials, a_variational_mean0)[source]#
svGPFA.utils.initUtils.getScaledIdentityQSigma0(scale, n_trials, nIndPointsPerLatent)[source]#
svGPFA.utils.initUtils.getUniformIndPointsMeans(n_trials, n_latents, nIndPointsPerLatent, min=-1, max=1)[source]#
svGPFA.utils.initUtils.getVariationalCov0(n_latents, n_trials, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None, n_ind_points=None)[source]#
svGPFA.utils.initUtils.getVariationalCov0InDict(n_latents, n_trials, params_dict, params_dict_type, n_ind_points=None, section_name='variational_params0', binary_item_name='variational_cov0', common_filename_item_name='variational_covs0_filename', different_filename_item_name_pattern='variational_cov0_filename_latent{:d}_trial{:d}', diag_value_item_name='variational_cov0_diag_value', delimiter=',')[source]#
svGPFA.utils.initUtils.getVariationalMean0(n_latents, n_trials, n_ind_points=None, dynamic_params_spec=None, config_file_params_spec=None, default_params_spec=None)[source]#
svGPFA.utils.initUtils.getVariationalMean0InDict(n_latents, n_trials, n_ind_points, params_dict, params_dict_type, section_name='variational_params0', binary_item_name='variational_mean0', common_filename_item_name='variational_means0_filename', different_filename_item_name_pattern='variational_mean0_filename_latent{:d}_trial{:d}', constant_value_item_name='variational_mean0_constant_value', delimiter=',')[source]#
svGPFA.utils.initUtils.strTo1DDoubleTensor(aString)[source]#
svGPFA.utils.initUtils.strTo1DIntTensor(aString)[source]#
svGPFA.utils.initUtils.strTo1DTensor(aString, dtype=<class 'numpy.float64'>, sep=', ')[source]#
svGPFA.utils.initUtils.strTo2DDoubleTensor(aString)[source]#
svGPFA.utils.initUtils.strTo2DIntTensor(aString)[source]#
svGPFA.utils.initUtils.strTo2DTensor(aString, dtype=torch.float64)[source]#

1.1.4.4. svGPFA.utils.miscUtils module#

svGPFA.utils.miscUtils.build3DdiagFromDiagVector(v, N, M)[source]#
svGPFA.utils.miscUtils.buildCovsFromCholVecs(cholVecs)[source]#
svGPFA.utils.miscUtils.buildKernels(kernels_types, kernels_params)[source]#
svGPFA.utils.miscUtils.buildQSigmaFromQSVecAndQSDiag(qSVec, qSDiag)[source]#
svGPFA.utils.miscUtils.chol3D(K)[source]#
svGPFA.utils.miscUtils.clock(func)[source]#
svGPFA.utils.miscUtils.computeSpikeClassificationROC(spikes_times, cif_times, cif_values, highres_bin_size=0.001)[source]#
svGPFA.utils.miscUtils.computeSpikeRates(trials_times, spikes_times)[source]#
svGPFA.utils.miscUtils.getCIFs(C, d, latents)[source]#
svGPFA.utils.miscUtils.getCholFromVec(vec, nIndPoints)[source]#
svGPFA.utils.miscUtils.getDiagIndicesIn3DArray(N, M, device=device(type='cpu'))[source]#
svGPFA.utils.miscUtils.getEmbeddingMeans(C, d, latents_means)[source]#
svGPFA.utils.miscUtils.getEmbeddingSTDs(C, latents_STDs)[source]#
svGPFA.utils.miscUtils.getEmbeddingSamples(C, d, latents_samples)[source]#
svGPFA.utils.miscUtils.getLatentsMeansAndSTDs(meansFuncs, kernels, trialsTimes)[source]#
svGPFA.utils.miscUtils.getLatentsSTDs(kernels, trialsTimes)[source]#
svGPFA.utils.miscUtils.getLatentsSamplesMeansAndSTDsFromSampledMeans(n_trials, sampledMeans, kernels, trialsTimes, latentsGPRegularizationEpsilon, dtype)[source]#
svGPFA.utils.miscUtils.getLegQuadPointsAndWeights(n_quad, trials_start_times, trials_end_times, dtype=torch.float64)[source]#
svGPFA.utils.miscUtils.getPropSamplesCovered(sample, mean, std, percent=0.95)[source]#
svGPFA.utils.miscUtils.getQSVecsAndQSDiagsFromQSCholVecs(qsCholVecs)[source]#
svGPFA.utils.miscUtils.getSRQSigmaVec(qSVec, qSDiag)[source]#
svGPFA.utils.miscUtils.getSRQSigmaVecsFromKzz(Kzz)[source]#
svGPFA.utils.miscUtils.getTrialsTimes(start_times, end_times, n_steps)[source]#
svGPFA.utils.miscUtils.getVectorRepOfLowerTrianMatrices(lt_matrices)[source]#

Returns vectors containing the lower-triangular elements of the input lower-triangular matrices.

Parameters:

lt_matrices (list) – a list of length n_latents, with lt_matrices[k] a tensor of dimension n_trials x n_ind_points x n_ind_points, where lt_matrices[k][r, :, :] is a lower-triangular matrix.

Returns:

a list vec_lt_matrices of length n_latents, whith vec_lt_matrices[k] a tensor of dimension (n_trials, n_ind_points*(n_ind_points+1)/2, 0), where vec_lt_matrices[k][r, :, 0] contains the vectorized lower-triangular elements of lt_matrices[k][r, :, :].

svGPFA.utils.miscUtils.orthonormalizeLatentsMeans(latents_means, C)[source]#
svGPFA.utils.miscUtils.pinv3D(K, rcond=1e-15)[source]#
svGPFA.utils.miscUtils.saveDataForMatlabEstimations(qMu, qSVec, qSDiag, C, d, indPointsLocs, legQuadPoints, legQuadWeights, kernelsTypes, kernelsParams, spikesTimes, indPointsLocsKMSRegEpsilon, trialsLengths, latentsTrialsTimes, emMaxIter, eStepMaxIter, mStepEmbeddingMaxIter, mStepKernelsMaxIter, mStepIndPointsMaxIter, saveFilename)[source]#
svGPFA.utils.miscUtils.separateNeuronsSpikeTimesByTrials(neurons_spike_times, epochs_times, trials_start_times_rel, trials_end_times_rel)[source]#

1.1.4.5. Module contents#