예제 #1
0
def test_synthetic_2():
    synthetic_dataset = SyntheticDataset()
    vaec = VAEC(synthetic_dataset.nb_genes, synthetic_dataset.n_batches, synthetic_dataset.n_labels)
    trainer_synthetic_vaec = JointSemiSupervisedTrainer(vaec, synthetic_dataset, use_cuda=use_cuda, frequency=1,
                                                        early_stopping_kwargs={'early_stopping_metric': 'll',
                                                                               'on': 'labelled_set',
                                                                               'save_best_state_metric': 'll'})
    trainer_synthetic_vaec.train(n_epochs=2)
예제 #2
0
def test_synthetic_2():
    synthetic_dataset = SyntheticDataset()
    vaec = VAEC(synthetic_dataset.nb_genes, synthetic_dataset.n_batches,
                synthetic_dataset.n_labels)
    infer_synthetic_vaec = JointSemiSupervisedVariationalInference(
        vaec,
        synthetic_dataset,
        use_cuda=use_cuda,
        early_stopping_metric='ll',
        frequency=1,
        save_best_state_metric='accuracy',
        on='labelled')
    infer_synthetic_vaec.train(n_epochs=20)
    infer_synthetic_vaec.svc_rf(unit_test=True)
예제 #3
0
파일: test_scvi.py 프로젝트: tkisss/scVI
def test_synthetic_2():
    synthetic_dataset = SyntheticDataset()
    vaec = VAEC(
        synthetic_dataset.nb_genes,
        synthetic_dataset.n_batches,
        synthetic_dataset.n_labels,
    )
    trainer_synthetic_vaec = JointSemiSupervisedTrainer(
        vaec,
        synthetic_dataset,
        use_cuda=use_cuda,
        frequency=1,
        early_stopping_kwargs={
            "early_stopping_metric": "reconstruction_error",
            "on": "labelled_set",
            "save_best_state_metric": "reconstruction_error",
        },
    )
    trainer_synthetic_vaec.train(n_epochs=2)
예제 #4
0
파일: test_scvi.py 프로젝트: sagoyal2/scVI
def test_synthetic_1():
    synthetic_dataset = SyntheticDataset()
    svaec = SVAEC(synthetic_dataset.nb_genes, synthetic_dataset.n_batches,
                  synthetic_dataset.n_labels)
    infer_synthetic_svaec = JointSemiSupervisedVariationalInference(
        svaec, synthetic_dataset, use_cuda=use_cuda)
    infer_synthetic_svaec.fit(n_epochs=1)
    infer_synthetic_svaec.entropy_batch_mixing('labelled')

    vaec = VAEC(synthetic_dataset.nb_genes, synthetic_dataset.n_batches,
                synthetic_dataset.n_labels)
    infer_synthetic_vaec = JointSemiSupervisedVariationalInference(
        vaec,
        synthetic_dataset,
        use_cuda=use_cuda,
        early_stopping_metric='ll',
        frequency=1,
        save_best_state_metric='accuracy',
        on='labelled')
    infer_synthetic_vaec.fit(n_epochs=20)
    infer_synthetic_vaec.svc_rf(unit_test=True)
    infer_synthetic_vaec.show_t_sne('labelled', n_samples=50)