tfclass_predict.prediction_manager
Classes
Prediction manager class. Coordinates the prediction for a single bed file. |
Functions
|
Generates count vectors from prediction results. |
Module Contents
- tfclass_predict.prediction_manager._generate_count_vectors(predictions, sequence_indices, num_classes=NUM_CLASSES)
Generates count vectors from prediction results. :param predictions: Aggregated predictions from Predictor.predict_bed_data() :param sequence_indices: Indices of each sequence in predictions. :param num_classes: Number of classes that were predicted. :return: Count vectors and prediction dictionary.
- class tfclass_predict.prediction_manager.PredictionManager(bed_file, genome_file, res_dir, bert_model, tfclass_model, tfargs=None)
Prediction manager class. Coordinates the prediction for a single bed file.
- iointerface
- tokenizer
- bed_data
- predictor
- _init_BERT(bert_model)
Initalizes the BERT tokenizer.
- Parameters:
bert_model – Path to BERT model directory.
- _init_devices(num_threads, num_gpus, num_cpus, memory_limit)
Initializes the devices, i.e. GPU and CPU usages.
- Parameters:
num_threads – Number of threads used.
num_gpus – Number of GPUs.
num_cpus – Number of CPUs.
memory_limit – Memory limit per GPU.
- _init_GPU(memory_limit=None)
Initializes GPU usage and enables memory growth.
- predict(subseq_length=15, batch_size=2000)
Start the prediction. :param subseq_length: Length in which a read should be split into subsequences. :param batch_size: Number of intervals that should be processed in one batch. :return: Count vectors and prediction dictionary.
- save_results()
Saves the prediction results to disk.