1.1.4. svGPFA.utils package#
1.1.4.1. Submodules#
1.1.4.2. svGPFA.utils.configUtils module#
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.buildUniformIndPointsLocs0(n_latents, n_trials, n_ind_points, trials_start_times, trials_end_times)[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.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.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
anddynamic_params_spec
.- Parameters:
n_neurons (integer) – number of neurons.
n_trials (integer) – number of trials.
n_latents (integer) – number of latents.
default_params_spec (list of dictionaries) – default parameters specification formated as described in Parameters and their specification and usually obtained using
svGPFA.utils.initUtils.getDefaultParamsDict()
,config_file_params_spec (list of dictionaries) – parameters specification obtained from a configuration file, formated as described in Parameters and their specification and usually obtained using
gcnu_common.utils.config_dict.GetDict
followed bysvGPFA.utils.initUtils.getParamsDictFromStringsDict()
,dynamic_params_spec (list of dictionaries) – parameters specification obtained from command line arguments, formated as described in Parameters and their specification and usually obtained using
svGPFA.utils.initUtils.getParamsDictFromArgs()
,
- 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.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]#
1.1.4.4. svGPFA.utils.miscUtils module#
- svGPFA.utils.miscUtils.computeSpikeClassificationROC(spikes_times, cif_times, cif_values, highres_bin_size=0.001)[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.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.saveDataForMatlabEstimations(qMu, qSVec, qSDiag, C, d, indPointsLocs, legQuadPoints, legQuadWeights, kernelsTypes, kernelsParams, spikesTimes, indPointsLocsKMSRegEpsilon, trialsLengths, latentsTrialsTimes, emMaxIter, eStepMaxIter, mStepEmbeddingMaxIter, mStepKernelsMaxIter, mStepIndPointsMaxIter, saveFilename)[source]#