Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leipzig Machine Learning Group
conML
python
Commits
7b535840
Commit
7b535840
authored
5 years ago
by
dmt
Browse files
Options
Downloads
Patches
Plain Diff
Add destruction settings and add 'knowledge_dir' as config parameter.
parent
4c120bb8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cml/shared/settings.py
+23
-13
23 additions, 13 deletions
cml/shared/settings.py
with
23 additions
and
13 deletions
cml/shared/settings.py
+
23
−
13
View file @
7b535840
...
...
@@ -56,11 +56,11 @@ class Settings(metaclass=MetaSettings):
LEARN_DIR
:
str
=
""
MAX_LEARN_DIR
:
int
=
0
USE_EXISTING_MODELS
:
bool
=
False
SET_FEATURES
:
str
=
""
KNOWLEDGE_DIR
=
""
SET_TARGETS
:
str
=
""
SORT_TIME_STAMP
:
bool
=
False
CUT_TIME_STAMP
:
bool
=
False
BLOCK_SIZE
:
int
=
0
MAX_BLOCKS
:
int
=
0
STACK_ITERATIONS
:
int
=
0
LEARN_BLOCK_MINIMUM
:
int
=
0
...
...
@@ -85,15 +85,20 @@ class PreprocessingSettings:
@dataclass
class
BlockProcessingSettings
:
block_size
=
int
max_blocks
=
int
stack_iterations
=
int
learn_block_minimum
=
int
sigma_zeta_cutoff
=
float
block_size
:
int
max_blocks
:
int
stack_iterations
:
int
learn_block_minimum
:
int
sigma_zeta_cutoff
:
float
@dataclass
class
DeconstructionSettings
:
pass
def
specific_settings_factory
(
settings_type
:
str
):
types
=
{
factory
=
{
"
general
"
:
starmap
(
GeneralSettings
,
[(
Settings
.
INPUT_FILE
,
Settings
.
LEARN_DIR
,
...
...
@@ -109,15 +114,19 @@ def specific_settings_factory(settings_type: str):
Settings
.
MAX_BLOCKS
,
Settings
.
STACK_ITERATIONS
,
Settings
.
LEARN_BLOCK_MINIMUM
,
Settings
.
SIGMA_ZETA_CUTOFF
)])
Settings
.
SIGMA_ZETA_CUTOFF
)]),
"
deconstruction
"
:
starmap
(
DeconstructionSettings
,
[()]
)
}
return
next
(
types
[
settings_type
])
return
next
(
factory
[
settings_type
])
def
read_settings
(
path
:
str
):
try
:
config
=
ConfigParser
(
path
)
config
=
ConfigParser
()
config
.
read
(
path
)
configure_main_settings_class
(
config
)
except
AttributeError
as
e
:
# TODO (dmt): Implement proper error handling.
...
...
@@ -126,11 +135,12 @@ def read_settings(path: str):
def
configure_main_settings_class
(
config
):
default
=
config
[
"
DEFAULT
"
]
default
=
config
[
"
GENERAL
"
]
Settings
.
INPUT_FILE
=
default
[
"
input_file
"
]
Settings
.
LEARN_DIR
=
default
[
"
learn_dir
"
]
Settings
.
MAX_LEARN_DIR
=
default
[
"
max_learn_dir
"
]
Settings
.
USE_EXISTING_MODELS
=
default
[
"
use_existing_models
"
]
Settings
.
KNOWLEDGE_DIR
=
default
[
"
knowledge_dir
"
]
preprocessing
=
config
[
"
PREPROCESSING
"
]
Settings
.
SET_FEATURES
=
preprocessing
[
"
set_features
"
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment