import timeit
import numpy as np
from sklearn.cluster import KMeans
np.random.seed(5)
X = np.random.rand(200000, 20)
X = np.float32(X)
estimator = KMeans()
Note on how to install caffe on Ubuntu. Sucessfully install using CPU, more information for GPU see this link
###Installation
- verify all the preinstallation according to CUDA guide e.g.
lspci | grep -i nvidia
I've tried to make SequentialDataset
support Cython fused types, but it seems really expensive.
You can find the modified code in this branch.
tl;dr - seq_dataset.pyx
is heavily bound with sag_fast.pyx
, sgd_fast.pyx
.
After I modified seq_dataset.pyx
, this line in sag_fast.pyx
requires to change as well since this pointer is passed into SequentialDataset
's function. However, my past experience is that one can only declare local floating
variable when at least one of the function's argument variable also belongs to floating
type. Nonetheless, that's not the case here, unless we make this function's arguments
np.ndarray[double, ndim=2, mode='c'] weights_array
np.ndarray[double, ndim=1, mode='c'] intercept_array
- #6593 Use fused types in sparse mean variance functions
- #6664 Make cython compiler directives global
- #6785 Make csr row norms support fused types
- #6846 Allows KMeans/MiniBatchKMeans to use float32 internally by using cython fused types
- #7053 Reduce duplicated code in _k_means.pyx
- #7170 Make Silhouette_score support sparse X
- #7184 Add whats_new about fixing example
- #7187 Rename CV params n_{folds,iter} to n_splits
require 'torch' | |
require 'nn' | |
require 'optim' | |
-- to specify these at runtime, you can do, e.g.: | |
-- $ lr=0.001 th main.lua | |
opt = { | |
dataset = 'video2', -- indicates what dataset load to use (in data.lua) | |
nThreads = 32, -- how many threads to pre-fetch data | |
batchSize = 64, -- self-explanatory |
import tensorflow as tf | |
import numpy | |
from sklearn.datasets import fetch_mldata | |
FLAGS = tf.app.flags.FLAGS | |
tf.app.flags.DEFINE_integer('seed', 1, "initial random seed") | |
tf.app.flags.DEFINE_string('layer_sizes', '784-1200-600-300-150-10', "layer sizes") |
The golden rule: do the most, with the least
(1-4 and 11 adapted from George Orwell's six rules)
- Rule 1: Never use a metaphor, simile, or other figure of speech that you are used to seeing in print
- Rule 2: Never use jargon if you can think of an everyday English equivalent
- Spend as much time on figures as you do on writing
- Use perceptual grouping to your advantage
- Never use default graphical styles; develop your own brand
- Minimize the data-ink ratio
- The figure should be understandable without reading the caption