本文整理汇总了Python中dataset.Dataset.store方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.store方法的具体用法?Python Dataset.store怎么用?Python Dataset.store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.store方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: StoreObject
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import store [as 别名]
class StoreObject(State):
def __init__(self, dataset, object_id):
State.__init__(self,
outcomes=['stored'],
input_keys=['bounding_boxes', 'clusters', 'mean',
'median', 'points'])
base = roslib.packages.get_pkg_dir(PACKAGE)
self.dataset = Dataset(join(base, 'common', 'data'), dataset)
self.object_id = object_id
def execute(self, ud):
self.dataset.store(self.object_id, ud.bounding_boxes[0].dimensions,
ud.points, ud.mean, ud.median)
return 'stored'
示例2: len
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import store [as 别名]
from sknn import mlp
train_none = glob.glob('data/*/placed?/*.png') + glob.glob('data/*/none/*.png')
train_red = glob.glob('data/*/red/*.png')
train_yellow = glob.glob('data/*/yellow/*.png')
print len(train_none)+len(train_red)+len(train_yellow)
print("Found total of %i files:" % (len(train_none)+len(train_red)+len(train_yellow)))
print(" - %i no trains," % len(train_none))
print(" - %i red trains," % len(train_red))
print(" - %i yellow ones.\n" % len(train_yellow))
ds = Dataset()
ds.store(train_none, 0, times=1)
ds.store(train_yellow, 1, times=4)
ds.store(train_red, 2, times=8)
X, y = ds.toarray()
nn = mlp.Classifier(
layers=[
mlp.Layer("Rectifier", units=64, dropout=0.3),
mlp.Layer("Rectifier", units=48, dropout=0.1),
mlp.Layer("Rectifier", units=32),
mlp.Layer("Softmax")],
learning_rate=0.01,
learning_rule='rmsprop',
n_iter=10,
示例3: print
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import store [as 别名]
from dataset import Dataset
positive = glob.glob('data/*/placed?/*.png')
negative = glob.glob('data/*/missing?/*.png')
unknown = glob.glob('data/*/unsure?/*.png')
print("Found total of %i files:" % len(positive+negative+unknown))
print(" - %i placed pieces," % len(positive))
print(" - %i missing pieces," % len(negative))
print(" - %i unsure images.\n" % len(unknown))
ds = Dataset()
ds.store(negative, 0, times=1)
ds.store(positive, 1, times=1)
ds.store(unknown, 2, times=2)
X, y = ds.toarray()
nn = mlp.Classifier(
layers=[
mlp.Layer("Rectifier", units=48, dropout=0.3),
mlp.Layer("Rectifier", units=32, dropout=0.1),
mlp.Layer("Rectifier", units=24),
mlp.Layer("Softmax")],
learning_rate=0.01,
learning_rule='adagrad',
n_iter=10,