Пример #1
0
 def create_sompy_modeladapter(cls, config, feedback_strategy):
     """Setup sompy model adapter which provides functionality required to train SOMPY Model with W2V encoding."""
     if feedback_strategy is None:
         feedback_strategy = FeedbackStrategy(config=config)
     storage_adapter = SomStorageAdapter(config, feedback_strategy)
     model_adapter = SomModelAdapter(storage_adapter)
     return model_adapter
def get_score(config, node_map, feedback):
    """Simple utility function for injecting custom mock function into Detector."""
    feedback_strategy = FeedbackStrategy(config, func=feedback)
    storage_adapter = SomStorageAdapter(config=config, feedback_strategy=feedback_strategy)
    model_adapter = SomModelAdapter(storage_adapter=storage_adapter)
    tc = SomTrainJob(node_map=node_map, model_adapter=model_adapter)
    success, dist = tc.execute()
    freq_one = dist[-1]
    return freq_one