当前位置: 首页>>代码示例>>Python>>正文


Python Dataset.store方法代码示例

本文整理汇总了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'
开发者ID:fsfrk,项目名称:hbrs-youbot-hackathon,代码行数:16,代码来源:collect_training_data.py

示例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,
开发者ID:aigamedev,项目名称:nuclai15,代码行数:33,代码来源:detect_trains.py

示例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,
开发者ID:aigamedev,项目名称:nuclai15,代码行数:32,代码来源:detect_pieces.py


注:本文中的dataset.Dataset.store方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。