summaryrefslogtreecommitdiff
path: root/ricky/dataset.py
diff options
context:
space:
mode:
authorPepper <pepper@scannerjammer.com>2019-12-04 04:30:53 +0000
committerPepper <pepper@scannerjammer.com>2019-12-04 04:30:53 +0000
commit65697891be538591f57384d3469ab2a7f2a86568 (patch)
tree5b34929c7e2c64abbec1949d755205839281456b /ricky/dataset.py
parent1d8ed6e2f6ffb872c2e29104067a28ae098ec290 (diff)
server_stuffserver_stuff
Diffstat (limited to 'ricky/dataset.py')
-rw-r--r--ricky/dataset.py32
1 files changed, 6 insertions, 26 deletions
diff --git a/ricky/dataset.py b/ricky/dataset.py
index 4f8a422..478ee5e 100644
--- a/ricky/dataset.py
+++ b/ricky/dataset.py
@@ -3,24 +3,6 @@ from ricky.utils import data_from_image
from pybrain.datasets import SupervisedDataSet
-# while subclassing this works, we should try to detect the length of params
-# and build a new data set for each type of params set...
-# therefore, an instance of SupervisedDataSet could actually be
-# accessed through the params instance...simplified one-to-one mapping
-
-# we are limited to only one classifier per params instance as well
-# however this is sort of a good thing, because built into the params
-# class can be a method that randomizes params, and then evaluates
-
-# we might be able to get this done through multiple inheritance
-# keep all dataset related stuff in a separate class to make it better organized
-
-# we need
-# .evaluate
-# .generate_liked_image
-# .train_from_url_list
-# .reset
-
class DataSet(SupervisedDataSet):
@@ -35,11 +17,9 @@ class DataSet(SupervisedDataSet):
target = 1
data_list = [data_from_image(image) for image in url_list if image]
for data in data_list:
- for params_class in ricky.params.Params.__subclasses__():
- if data['module'] == params_class.__name__:
- params_instance = params_class()
- params_instance.from_dict(data['params'])
- self.addSample(
- params_instance.as_normalized(),
- target
- )
+ params_instance = Params.new_class_from_classname(data['module'])
+ params_instance.from_dict(data['params'])
+ self.addSample(
+ params_instance.as_normalized(),
+ target
+ )