Пример #1
0
def test_symmetric():
    """Test running a model with symmetric ROIs.
    """
    dataset_file = join(get_test_data_path(), 'gclda_dataset.pkl')
    dset = Dataset.load(dataset_file)
    model = Model(dset,
                  n_topics=50,
                  n_regions=2,
                  symmetric=True,
                  alpha=.1,
                  beta=.01,
                  gamma=.01,
                  delta=1.,
                  dobs=25,
                  roi_size=10.,
                  seed_init=1)
    initial_iter = model.iter
    model.run_complete_iteration()
    assert model.iter == initial_iter + 1
Пример #2
0
# Initialize dataset
# ----------------------------------
dataset_label = 'Neurosynth2015Filtered2_1000docs'
dataset_dir = join(get_resource_path(), 'datasets')
dataset = Dataset(dataset_label, dataset_dir)
dataset.display_dataset_summary()

###############################################################################
# Initialize model
# ----------------------
model = Model(dataset,
              n_topics=200,
              n_regions=2,
              alpha=.1,
              beta=.01,
              gamma=.01,
              delta=1.0,
              dobs=25,
              roi_size=50,
              symmetric=True,
              seed_init=1)
model.display_model_summary()

###############################################################################
# Run model (10 iterations)
# -------------------------
n_iterations = 10
for i in range(model.iter, n_iterations):
    model.run_complete_iteration(loglikely_freq=10, verbose=1)
model.display_model_summary()