tfclass_predict.prediction_manager ================================== .. py:module:: tfclass_predict.prediction_manager Classes ------- .. autoapisummary:: tfclass_predict.prediction_manager.PredictionManager Functions --------- .. autoapisummary:: tfclass_predict.prediction_manager._generate_count_vectors Module Contents --------------- .. py:function:: _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. .. py:class:: PredictionManager(bed_file, genome_file, res_dir, bert_model, tfclass_model, tfargs=None) Prediction manager class. Coordinates the prediction for a single bed file. .. py:attribute:: iointerface .. py:attribute:: tokenizer .. py:attribute:: bed_data .. py:attribute:: predictor .. py:method:: _init_BERT(bert_model) Initalizes the BERT tokenizer. :param bert_model: Path to BERT model directory. .. py:method:: _init_devices(num_threads, num_gpus, num_cpus, memory_limit) Initializes the devices, i.e. GPU and CPU usages. :param num_threads: Number of threads used. :param num_gpus: Number of GPUs. :param num_cpus: Number of CPUs. :param memory_limit: Memory limit per GPU. .. py:method:: _init_GPU(memory_limit=None) Initializes GPU usage and enables memory growth. .. py:method:: 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. .. py:method:: save_results() Saves the prediction results to disk.