diff --git a/.gitignore b/.gitignore index 90323d4..28b111e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,87 +1,90 @@ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class + +*.vpp.lck + .pytest_cache/ *.vpp.bak_* python_tests_xml # C extensions *.so # Distribution / packaging .Python env/ build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ *.egg-info/ .installed.cfg *.egg .idea/ # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *,cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log # Sphinx documentation docs/_build/ doc/ # PyBuilder target/ #Ipython Notebook .ipynb_checkpoints #Pycharm files *.iml # merging stuff *.orig *~ # Paths in repository mcml.py # images etc *.tif *.nrrd *.caffemodel # C++ stuff build* *.user diff --git a/hyppopy/workflows/imageregistration_usecase/imageregistration_usecase.py b/hyppopy/workflows/imageregistration_usecase/imageregistration_usecase.py index 652393a..29d811a 100644 --- a/hyppopy/workflows/imageregistration_usecase/imageregistration_usecase.py +++ b/hyppopy/workflows/imageregistration_usecase/imageregistration_usecase.py @@ -1,52 +1,52 @@ # DKFZ # # # Copyright (c) German Cancer Research Center, # Division of Medical and Biological Informatics. # All rights reserved. # # This software is distributed WITHOUT ANY WARRANTY; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. # # See LICENSE.txt or http://www.mitk.org for details. # # Author: #------------------------------------------------------ # this needs to be imported, dont remove these from hyppopy.projectmanager import ProjectManager from hyppopy.workflows.workflowbase import WorkflowBase #------------------------------------------------------ # import your external packages from sklearn.ensemble import RandomForestClassifier from sklearn.model_selection import cross_val_score # import your custom DataLoader -from hyppopy.workflows.dataloader.simpleloader import SimpleDataLoaderBase # This is a dataloader class create your own +from hyppopy.workflows.dataloader.simpleloader import SimpleDataLoader # This is a dataloader class create your own class imageregistration_usecase(WorkflowBase): def setup(self, **kwargs): # here you create your own DataLoader instance - dl = SimpleDataLoaderBase() + dl = SimpleDataLoader() # call the start function of your DataLoader dl.start(path=ProjectManager.data_path, data_name=ProjectManager.data_name, labels_name=ProjectManager.labels_name) # pass the data to the solver self.solver.set_data(dl.data) def blackbox_function(self, data, params): # converting number back to integers is an ugly hack that will be removed in the future if "n_estimators" in params.keys(): params["n_estimators"] = int(round(params["n_estimators"])) # Do your training clf = RandomForestClassifier(**params) # compute your loss loss = -cross_val_score(estimator=clf, X=data[0], y=data[1], cv=3).mean() # return loss return loss diff --git a/planning/Hyppopy.vpp b/planning/Hyppopy.vpp index e3ea8dd..0890b31 100644 Binary files a/planning/Hyppopy.vpp and b/planning/Hyppopy.vpp differ