Blame view

datasets/test_timit.ipynb 1.89 KB
f2d3bd141   Parcollet Titouan   Initial commit wi...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
  {
   "cells": [
    {
     "cell_type": "code",
     "execution_count": 1,
     "metadata": {},
     "outputs": [
      {
       "name": "stderr",
       "output_type": "stream",
       "text": [
        "/home/ying/.local/lib/python2.7/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  ",
        "  from ._conv import register_converters as _register_converters
  "
       ]
      }
     ],
     "source": [
      "from timit import Timit
  ",
      "from utils import construct_conv_stream
  ",
      "import numpy as np"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 15,
     "metadata": {},
     "outputs": [],
     "source": [
      "dataset = Timit('train')
  ",
      "rng=np.random.RandomState(123)
  ",
      "data_stream = construct_conv_stream(dataset, rng, 1000, 10000, batch_size=10)"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 16,
     "metadata": {},
     "outputs": [],
     "source": [
      "iterator = data_stream.get_epoch_iterator()"
     ]
    },
    {
     "cell_type": "code",
     "execution_count": 17,
     "metadata": {},
     "outputs": [
      {
       "name": "stdout",
       "output_type": "stream",
       "text": [
        "(19, 3, 41, 545) (19, 1) (19, 67) (19, 1)
  "
       ]
      }
     ],
     "source": [
      "input, input_length, label, label_length = iterator.next()
  ",
      "print input.shape, input_length.shape, label.shape, label_length.shape"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
     "display_name": "Python 2",
     "language": "python",
     "name": "python2"
    },
    "language_info": {
     "codemirror_mode": {
      "name": "ipython",
      "version": 2
     },
     "file_extension": ".py",
     "mimetype": "text/x-python",
     "name": "python",
     "nbconvert_exporter": "python",
     "pygments_lexer": "ipython2",
     "version": "2.7.12"
    }
   },
   "nbformat": 4,
   "nbformat_minor": 2
  }