Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restricted local step function for HDPHMM- HDP-HMM with moves #20

Open
Jingyao12 opened this issue Jan 17, 2019 · 0 comments
Open

Restricted local step function for HDPHMM- HDP-HMM with moves #20

Jingyao12 opened this issue Jan 17, 2019 · 0 comments

Comments

@Jingyao12
Copy link

Jingyao12 commented Jan 17, 2019

Hi
It is me again. I am trying to combine moves with HDP-HMM using following parameters for my own data

goodelbopairs_merge_kwargs = dict(
m_startLap = 2,
# Set limits to number of merges attempted each lap.
# This value specifies max number of tries for each cluster
m_maxNumPairsContainingComp = 5,
# Set "reactivation" limits
# So that each cluster is eligible again after 10 passes thru dataset
# Or when it's size changes by 400%
m_nLapToReactivate = 10,
m_minPercChangeInNumAtomsToReactivate = 400 * 0.01,
# Specify how to rank pairs (determines order in which merges are tried)
# 'obsmodel_elbo' means rank pairs by improvement to observation model ELBO
m_pair_ranking_procedure = 'obsmodel_elbo',
m_pair_ranking_direction = 'descending',
)
goodelbopairs_delete_kwargs =dict(
d_startLap=2

)

goodelbopairs_trained_model, goodelbopairs_info_dict = bnpy.run(
myData, 'HDPHMM', 'DiagGauss', 'memoVB',

moves='delete,shuffle',
**dict(
    alg_kwargs.items()
    + init_kwargs.items()
    + hdphmm_kwargs.items()
    + gauss_kwargs.items()
    + goodelbopairs_delete_kwargs.items()))

The error is as follows

Dataset Summary:
GroupXData
total size: 24 units
batch size: 24 units
num. batches: 1
Allocation Model: None
Obs. Data Model: Gaussian with diagonal covariance.
Obs. Data Prior: independent Gauss-Wishart prior on each dimension
Wishart params
nu = 22 ...
beta = [ 20 20] ...
Expectations
E[ mean[k]] =
[ 0 0] ...
E[ covar[k]] =
[[1. 0.]
[0. 1.]] ...
Initialization:
initname = randexamples
K = 50 (number of clusters)
seed = 1607680
elapsed_time: 1.7 sec
Learn Alg: memoVB | task 1/1 | alg. seed: 1607680 | data order seed: 8541952
task_output_path: /trylargefish-K=20-model=HDPHMM+DiagGauss-ECovMat=1*eye-merge_strategy=good_elbo_pairs/1
DELETE @ lap 1.00: Disabled. Cannot delete before first complete lap, because SS that represents whole dataset is required.
1.000/100 after 555 sec. | 726.0 MiB | K 50 | loss 7.068809849e-01 |

NotImplementedError Traceback (most recent call last)
in ()
29 + gauss_kwargs.items()
30 # + goodelbopairs_merge_kwargs.items()
---> 31 + goodelbopairs_delete_kwargs.items()))
32
33

/bnpy/bnpy/Run.pyc in run(dataName, allocModelName, obsModelName, algName, doSaveToDisk, doWriteStdOut, taskID, **kwargs)
92 dataName, allocModelName,
93 obsModelName, algName,
---> 94 doSaveToDisk, doWriteStdOut)
95 if (taskid == starttaskid or info_dict['loss'] < best_loss):
96 bestModel = hmodel

/bnpy/bnpy/Run.pyc in _run_task_internal(jobname, taskid, nTask, ReqArgs, KwArgs, UnkArgs, dataName, allocModelName, obsModelName, algName, doSaveToDisk, doWriteStdOut)
221
222 # Fit the model to the data!
--> 223 RunInfo = learnAlg.fit(hmodel, Data)
224 RunInfo['UnkArgs'] = UnkArgs
225 RunInfo['KwArgs'] = KwArgs

/bnpy/bnpy/learnalg/MemoVBMovesAlg.pyc in fit(self, hmodel, DataIterator, **kwargs)
118 MovePlans=MovePlans,
119 MoveRecordsByUID=MoveRecordsByUID,
--> 120 MoveLog=MoveLog)
121
122 self.saveDebugStateAtBatch(

/bnpy/bnpy/learnalg/MemoVBMovesAlg.pyc in calcLocalParamsAndSummarize_withExpansionMoves(self, DataIterator, curModel, SS, batchID, lapFrac, MovePlans, MoveRecordsByUID, MoveLog, **kwargs)
408 nUpdateSteps=DKwargs['d_nRefineSteps'],
409 d_initTargetDocTopicCount=DKwargs['d_initTargetDocTopicCount'],
--> 410 d_initWordCounts=DKwargs['d_initWordCounts'],
411 )
412 ElapsedTimeLogger.stopEvent('delete', 'localexpansion')

/bnpy/bnpy/birthmove/BRestrictedLocalStep.pyc in summarizeRestrictedLocalStep(Dslice, curModel, curLPslice, **kwargs)
30 if allocModelName not in RestrictedLocalStepFuncMap:
31 raise NotImplementedError('Restricted local step function for ' +
---> 32 allocModelName)
33 xSSslice = RestrictedLocalStepFuncMap[allocModelName](
34 Dslice=Dslice,

NotImplementedError: Restricted local step function for HDPHMM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant