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)
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)
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)
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)