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

All Samples(148)  |  Call(119)  |  Derive(0)  |  Import(29)

src/p/y/pylearn2-HEAD/pylearn2/datasets/sparse_dataset.py   pylearn2(Download)
floatX = theano.config.floatX
logger = logging.getLogger(__name__)
from pylearn2.space import CompositeSpace, VectorSpace
from pylearn2.utils import safe_zip
from pylearn2.utils.iteration import (
                raise TypeError(msg)
 
        X_space = VectorSpace(dim=self.X.shape[1], sparse=True)
        self.X_space = X_space
        space = self.X_space

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
            X_source = 'features'
            if X_labels is None:
                X_space = VectorSpace(dim=X.shape[1])
            else:
                if X.ndim == 1:
                    y_space = IndexSpace(dim=dim, max_labels=y_labels)
                else:
                    y_space = VectorSpace(dim=dim)
                y_source = 'targets'
 
        if not all(m in d for m in ('data_specs', 'X_space',
                                    '_iter_data_specs', 'X_topo_space')):
            X_space = VectorSpace(dim=self.X.shape[1])
            X_source = 'features'
            if self.y is None:
                space = X_space
                source = X_source
            else:
                y_space = VectorSpace(dim=self.y.shape[-1])

src/p/y/pylearn2-HEAD/pylearn2/models/sparse_autoencoder.py   pylearn2(Download)
from theano import tensor
from pylearn2.models.autoencoder import DenoisingAutoencoder
from pylearn2.space import VectorSpace
from theano.sparse.sandbox.sp2 import sampling_dot
 
        del self.w_prime
 
        self.input_space = VectorSpace(nvis, sparse=True)
 
    def get_params(self):

src/p/y/pylearn2-HEAD/pylearn2/datasets/norb.py   pylearn2(Download)
from pylearn2.datasets import dense_design_matrix
from pylearn2.datasets.cache import datasetCache
from pylearn2.space import VectorSpace, Conv2DSpace, CompositeSpace
 
 
        conv2d_space = make_conv2d_space(shape, axes)
        self.topo_space = CompositeSpace((conv2d_space, conv2d_space))
        self.storage_space = VectorSpace(dim=numpy.prod(shape))
 
    def get_formatted_batch(self, batch, space):

src/p/y/pylearn2-HEAD/pylearn2/datasets/preprocessing.py   pylearn2(Download)
from pylearn2.blocks import Block
from pylearn2.linear.conv2d import Conv2D
from pylearn2.space import Conv2DSpace, VectorSpace
from pylearn2.expr.preprocessing import global_contrast_normalize
from pylearn2.utils.insert_along_axis import insert_columns
            WRITEME
        """
        return VectorSpace(dim=self._total)
 
    def get_output_space(self):
            WRITEME
        """
        return VectorSpace(dim=self._columns)
 
 
            WRITEME
        """
        return VectorSpace(dim=self._columns)
 
    def get_output_space(self):
            WRITEME
        """
        return VectorSpace(dim=self._total)
 
 

src/k/a/kaggle-dogs-vs-cats-HEAD/kaggle_train_full.py   kaggle-dogs-vs-cats(Download)
from pylearn2.train import Train
from pylearn2.train_extensions import best_params
from pylearn2.space import VectorSpace
import pickle
import numpy as np
y = pickle.load(open('saved_y.pkl', 'rb'))
y = to_one_hot(y)
in_space = VectorSpace(dim=x.shape[1])
full = DenseDesignMatrix(X=x, y=y)
 

src/p/y/pylearn2-HEAD/pylearn2/models/dbm/layer.py   pylearn2(Download)
from pylearn2.models import Model
from pylearn2.models.dbm import init_sigmoid_bias_from_marginals
from pylearn2.space import VectorSpace, CompositeSpace, Conv2DSpace, Space
from pylearn2.utils import is_block_gradient
from pylearn2.utils import sharedX, safe_zip, py_integer_types, block_gradient
        del self.bias_from_marginals
 
        self.space = VectorSpace(nvis)
        self.input_space = self.space
 
            self.requires_reformat = True
            self.input_dim = space.get_total_dimension()
            self.desired_space = VectorSpace(self.input_dim)
 
 
        if not (self.detector_layer_dim % self.pool_size == 0):
            raise ValueError("detector_layer_dim = %d, pool_size = %d. Should be divisible but remainder is %d" %
                    (self.detector_layer_dim, self.pool_size, self.detector_layer_dim % self.pool_size))
 
        self.h_space = VectorSpace(self.detector_layer_dim)
        self.h_space = VectorSpace(self.detector_layer_dim)
        self.pool_layer_dim = self.detector_layer_dim / self.pool_size
        self.output_space = VectorSpace(self.pool_layer_dim)
 
        rng = self.dbm.rng

src/p/y/pylearn2-HEAD/pylearn2/models/mlp.py   pylearn2(Download)
from pylearn2.space import Conv2DSpace
from pylearn2.space import Space
from pylearn2.space import VectorSpace
from pylearn2.utils import function
from pylearn2.utils import is_iterable
 
            if nvis is not None:
                input_space = VectorSpace(nvis)
 
            self.input_space = input_space
        assert isinstance(n_classes, py_integer_types)
 
        self.output_space = VectorSpace(n_classes)
        if not no_affine:
            self.b = sharedX(np.zeros((n_classes,)), name='softmax_b')
        else:
            desired_dim = self.input_dim
        self.desired_space = VectorSpace(desired_dim)
 
        if not self.needs_reformat:
            self.requires_reformat = True
            self.input_dim = space.get_total_dimension()
            self.desired_space = VectorSpace(self.input_dim)
 
        if not (self.detector_layer_dim % self.pool_size == 0):

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,
                            VectorSpace,
                            Conv2DSpace,
def test_np_format_as_vector2vector():
    vector_space_initial = VectorSpace(dim=8*8*3, sparse=False)
    vector_space_final = VectorSpace(dim=8*8*3, sparse=False)
    data = np.arange(5*8*8*3).reshape(5, 8*8*3)
    rval = vector_space_initial.np_format_as(data, vector_space_final)
def test_np_format_as_vector2conv2d():
    vector_space = VectorSpace(dim=8*8*3, sparse=False)
    conv2d_space = Conv2DSpace(shape=(8, 8), num_channels=3,
                               axes=('b', 'c', 0, 1))
    data = np.arange(5*8*8*3).reshape(5, 8*8*3)
def test_np_format_as_conv2d2vector():
    vector_space = VectorSpace(dim=8*8*3, sparse=False)
    conv2d_space = Conv2DSpace(shape=(8, 8), num_channels=3,
                               axes=('b', 'c', 0, 1))
    data = np.arange(5*8*8*3).reshape(5, 3, 8, 8)

src/p/y/pylearn2-HEAD/pylearn2/models/dbm/ising.py   pylearn2(Download)
from pylearn2.models.dbm.layer import HiddenLayer, VisibleLayer
from pylearn2.space import Conv2DSpace
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX
from pylearn2.utils.rng import make_theano_rng
        del self.bias_from_marginals
 
        self.space = VectorSpace(nvis)
        self.input_space = self.space
 
            self.requires_reformat = True
            self.input_dim = space.get_total_dimension()
            self.desired_space = VectorSpace(self.input_dim)
 
        self.output_space = VectorSpace(self.dim)
            WRITEME
        """
        return VectorSpace(self.dim)
 
    def get_params(self):

  1 | 2 | 3  Next