Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(15)  |  Call(11)  |  Derive(0)  |  Import(4)

src/p/y/pylearn2-HEAD/pylearn2/datasets/dense_design_matrix.py   pylearn2(Download)
from pylearn2.datasets.dataset import Dataset
from pylearn2.datasets import control
from pylearn2.space import CompositeSpace, Conv2DSpace, VectorSpace, IndexSpace
from pylearn2.utils import safe_zip
from pylearn2.utils.rng import make_np_rng
                    dim = X.shape[-1]
                X_space = IndexSpace(dim=dim, max_labels=X_labels)
            if y is None:
                space = X_space
                    dim = y.shape[-1]
                if y_labels is not None:
                    y_space = IndexSpace(dim=dim, max_labels=y_labels)
                    y_space = VectorSpace(dim=dim)
            # This is to support old pickled models
            if getattr(self, 'y_labels', None) is not None:
                y_space = IndexSpace(dim=dim, max_labels=self.y_labels)
            elif getattr(self, 'max_labels', None) is not None:
                y_space = IndexSpace(dim=dim, max_labels=self.max_labels)

src/p/y/pylearn2-HEAD/pylearn2/space/tests/test_space.py   pylearn2(Download)
# Can't use nose.tools.assert_raises, only introduced in python 2.7. Use
# numpy.testing.assert_raises instead
from pylearn2.space import (SimplyTypedSpace,
def test_np_format_as_index2index():
    index_space_initial = IndexSpace(max_labels=10, dim=1)
    index_space_final = IndexSpace(max_labels=10, dim=1)
    data = np.array([[0], [2], [1], [3], [5], [8], [1]])
    rval = index_space_initial.np_format_as(data, index_space_final)
    assert index_space_initial == index_space_final
    assert np.all(rval == data)
    index_space_downcast = IndexSpace(max_labels=10, dim=1, dtype='int32')
    index_sequence_space = IndexSequenceSpace(max_labels=6, dim=1)
    index_space = IndexSpace(max_labels=6, dim=1)
    data = np.random.randint(low=0, high=5, size=(10, 1))

src/p/y/pylearn2-HEAD/pylearn2/sandbox/nlp/models/mlp.py   pylearn2(Download)
from pylearn2.models import mlp
from pylearn2.models.mlp import Layer
from pylearn2.space import IndexSpace
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX

src/p/y/pylearn2-HEAD/pylearn2/datasets/tests/test_mnist.py   pylearn2(Download)
from pylearn2.datasets.mnist import MNIST
from pylearn2.space import IndexSpace, VectorSpace
import unittest
from pylearn2.testing.skip import skip_if_no_data
import numpy as np
        over them works
        data_specs = (IndexSpace(max_labels=10, dim=1), 'targets')
        it = self.test.iterator(mode='sequential',