Skip to content

Commit

Permalink
- Added full support for regression models
Browse files Browse the repository at this point in the history
- Functional models are now natively supported
- 'functional_support' argument removed from Scan()
- Removed master log feature
- Removed score_model to make way for adding full support for sklearn.metrics based scoring
- Added sklearn.metrics to ta.performance
  • Loading branch information
C0NTRIBUTE authored and C0NTRIBUTE committed Oct 10, 2018
1 parent 2d08a5f commit 8942e72
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 266 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
URL = 'http://autonom.io'
LICENSE = 'MIT'
DOWNLOAD_URL = 'https://github.com/autonomio/talos/'
VERSION = '0.4.3'
VERSION = '0.4.4'

try:
from setuptools import setup
Expand Down
6 changes: 1 addition & 5 deletions talos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
from .commands.evaluate import Evaluate
from. commands.restore import Restore

from .metrics.performance import Performance
from .examples import datasets, params
import astetik as plots
from kerasplotlib import TrainingLog as live

# del parameters, utils, scan
# del Performance, reporting, reducers, metrics, examples

__version__ = "0.4.3"
__version__ = "0.4.4"
125 changes: 0 additions & 125 deletions talos/metrics/performance.py

This file was deleted.

43 changes: 0 additions & 43 deletions talos/metrics/score_model.py

This file was deleted.

15 changes: 6 additions & 9 deletions talos/scan/Scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,18 @@ class Scan:
The fraction of `params` that will be tested (Default is None).
reduction_metric : {'val_acc'}
Metric used to tune the reductions.
talos_log_name : str
The lame of the saved Talos log. (Default is 'talos.log').
debug : bool
Implements debugging feedback. (Default is False).
x_val : ndarray
User specified cross-validation data. (Default is None).
y_val : ndarray
User specified cross-validation labels. (Default is None).
last_epoch_value : bool
Set to True if the last epoch metric values are logged as opposed
to the default which is peak epoch values for each round.
print_params : bool
Print params for each round on screen (useful when using TrainingLog
callback for visualization)
debug : bool
Implements debugging feedback. (Default is False).
"""

Expand All @@ -123,12 +124,10 @@ def __init__(self, x, y, params, model,
reduction_metric='val_acc',
reduce_loss=False,
last_epoch_value=False,
talos_log_name='talos.log',
clear_tf_session=True,
functional_model=False,
disable_progress_bar=False,
print_params=False,
debug=False,):
debug=False):

# NOTE: these need to be follow the order from __init__
# and all paramaters needs to be included here and only here.
Expand All @@ -153,12 +152,10 @@ def __init__(self, x, y, params, model,
self.reduction_metric = reduction_metric
self.reduce_loss = reduce_loss
self.round_limit = round_limit
self.talos_log_name = talos_log_name
self.debug = debug
self.seed = seed
self.clear_tf_session = clear_tf_session
self.disable_progress_bar = disable_progress_bar
self.functional_model = functional_model
self.last_epoch_value = last_epoch_value
self.print_params = print_params
# input parameters section ends
Expand Down
4 changes: 0 additions & 4 deletions talos/scan/scan_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from ..parameters.ParamGrid import ParamGrid
from ..utils.pred_class import classify
from ..utils.last_neuron import last_neuron
from ..utils.logging import debug_logging


TRAIN_VAL_RUNTIME_ERROR_MSG = """
Expand All @@ -18,9 +17,6 @@ def scan_prepare(self):
'''Includes all preparation procedures up until starting the first scan
through scan_run()'''

# based on the 'debug' Scan() paramater
self = debug_logging(self)

# create the name for the experiment
if self.dataset_name is None:
self.dataset_name = strftime('%D%H%M%S').replace('/', '')
Expand Down
5 changes: 1 addition & 4 deletions talos/scan/scan_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from ..utils.results import create_header
from ..metrics.entropy import epoch_entropy
from ..model.ingest_model import ingest_model
from ..metrics.score_model import get_score
from ..utils.logging import write_log
from ..utils.results import run_round_results, save_result
from ..reducers.reduce_run import reduce_run
from ..utils.exceptions import TalosReturnError, TalosTypeError
Expand Down Expand Up @@ -44,8 +42,7 @@ def scan_round(self):
save_result(self)

_hr_out = run_round_results(self, _hr_out)
self._val_score = get_score(self)
write_log(self)

self.result.append(_hr_out)
save_result(self)

Expand Down
1 change: 0 additions & 1 deletion talos/scan/scan_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from .scan_round import scan_round
from .scan_finish import scan_finish


def scan_run(self):

'''The high-level management of the scan procedures
Expand Down
69 changes: 0 additions & 69 deletions talos/utils/logging.py

This file was deleted.

6 changes: 1 addition & 5 deletions test/core_tests/test_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@

from talos.scan.Scan import Scan
from talos.commands.reporting import Reporting

from talos.examples.models import iris_model, cervix_model

# remotely hosted datasets
from talos import datasets, params

p1 = {'lr': [1],
Expand Down Expand Up @@ -78,8 +75,7 @@ def test_scan_iris_2(self):
print("Running Iris dataset test 2...")
Scan(self.x, self.y, params=p2, dataset_name='testing',
experiment_no='000', model=iris_model,
last_epoch_value=True,
functional_model=True)
last_epoch_value=True)

def test_scan_iris_explicit_validation_set(self):
print("Running explicit validation dataset test with metric reduction")
Expand Down

0 comments on commit 8942e72

Please sign in to comment.