ontolearn.learners.clip ======================= .. py:module:: ontolearn.learners.clip .. autoapi-nested-parse:: CLIP: Concept Learner with Integrated Length Prediction. Classes ------- .. autoapisummary:: ontolearn.learners.clip.CLIP Module Contents --------------- .. py:class:: CLIP(knowledge_base: ontolearn.abstracts.AbstractKnowledgeBase, reasoner: Optional[owlapy.abstracts.AbstractOWLReasoner] = None, refinement_operator: Optional[ontolearn.abstracts.BaseRefinement[ontolearn.search.OENode]] = ExpressRefinement, quality_func: Optional[ontolearn.abstracts.AbstractScorer] = None, heuristic_func: Optional[ontolearn.abstracts.AbstractHeuristic] = None, terminate_on_goal: Optional[bool] = None, iter_bound: Optional[int] = None, max_num_of_concepts_tested: Optional[int] = None, max_runtime: Optional[int] = None, max_results: int = 10, best_only: bool = False, calculate_min_max: bool = True, path_of_embeddings='', predictor_name=None, pretrained_predictor_name=['SetTransformer', 'LSTM', 'GRU', 'CNN'], load_pretrained=False, num_workers=4, num_examples=1000, output_size=15) Bases: :py:obj:`ontolearn.learners.CELOE` Concept Learner with Integrated Length Prediction. This algorithm extends the CELOE algorithm by using concept length predictors and a different refinement operator, i.e., ExpressRefinement .. attribute:: best_descriptions Best hypotheses ordered. :type: EvaluatedDescriptionSet[OENode, QualityOrderedNode] .. attribute:: best_only If False pick only nodes with quality < 1.0, else pick without quality restrictions. :type: bool .. attribute:: calculate_min_max Calculate minimum and maximum horizontal expansion? Statistical purpose only. :type: bool .. attribute:: heuristic_func Function to guide the search heuristic. :type: AbstractHeuristic .. attribute:: heuristic_queue A sorted set that compares the nodes based on Heuristic. :type: SortedSet[OENode] .. attribute:: iter_bound Limit to stop the algorithm after n refinement steps are done. :type: int .. attribute:: kb The knowledge base that the concept learner is using. :type: AbstractKnowledgeBase .. attribute:: max_child_length Limit the length of concepts generated by the refinement operator. :type: int .. attribute:: max_he Maximal value of horizontal expansion. :type: int .. attribute:: max_num_of_concepts_tested :type: int .. attribute:: max_runtime Limit to stop the algorithm after n seconds. :type: int .. attribute:: min_he Minimal value of horizontal expansion. :type: int .. attribute:: name Name of the model = 'celoe_python'. :type: str .. attribute:: _number_of_tested_concepts Yes, you got it. This stores the number of tested concepts. :type: int .. attribute:: operator Operator used to generate refinements. :type: BaseRefinement .. attribute:: quality_func :type: AbstractScorer .. attribute:: reasoner The reasoner that this model is using. :type: AbstractOWLReasoner .. attribute:: search_tree Dict to store the TreeNode for a class expression. :type: Dict[OWLClassExpression, TreeNode[OENode]] .. attribute:: start_class The starting class expression for the refinement operation. :type: OWLClassExpression .. attribute:: start_time The time when :meth:`fit` starts the execution. Used to calculate the total time :meth:`fit` takes to execute. :type: float .. attribute:: terminate_on_goal Whether to stop the algorithm if a perfect solution is found. :type: bool .. py:attribute:: __slots__ :value: ('best_descriptions', 'max_he', 'min_he', 'best_only', 'calculate_min_max', 'heuristic_queue',... .. py:attribute:: name :value: 'CLIP' .. py:attribute:: predictor_name :value: None .. py:attribute:: pretrained_predictor_name :value: ['SetTransformer', 'LSTM', 'GRU', 'CNN'] .. py:attribute:: knowledge_base .. py:attribute:: load_pretrained :value: False .. py:attribute:: num_workers :value: 4 .. py:attribute:: output_size :value: 15 .. py:attribute:: num_examples :value: 1000 .. py:attribute:: path_of_embeddings :value: '' .. py:attribute:: device .. py:attribute:: length_predictor .. py:method:: get_length_predictor() .. py:method:: refresh() .. py:method:: collate_batch(batch) .. py:method:: collate_batch_inference(batch) .. py:method:: pos_neg_to_tensor(pos: Union[List[owlapy.owl_individual.OWLNamedIndividual], List[str]], neg: Union[List[owlapy.owl_individual.OWLNamedIndividual], List[str]]) .. py:method:: predict_length(models, x_pos, x_neg) .. py:method:: fit(*args, **kwargs) Find hypotheses that explain pos and neg. .. py:method:: train(data: Iterable[List[Tuple]], epochs=300, batch_size=256, learning_rate=0.001, decay_rate=0.0, clip_value=5.0, save_model=True, storage_path=None, optimizer='Adam', record_runtime=True, example_sizes=None, shuffle_examples=False) Train RL agent on learning problems. :returns: self.