Skip to content

Instantly share code, notes, and snippets.

View kudkudak's full-sized avatar
😃

Stanislaw Jastrzebski kudkudak

😃
View GitHub Profile
def act(self):
if len(self.command_queue) == 0:
if self.state == Rotator.STATE_ROTATE:
self.command_queue.append([TURN, \
self.state_helper * int((0.5*pi)/ TICK_ROTATE )]) # Rotate by 90 deegres
self.state_helper *= -1
return self.command_queue.pop(0)
def act(self):
if len(self.command_queue) == 0:
if self.state == Rotator.STATE_ROTATE:
self.command_queue.append([TURN, \
self.state_helper * int((0.5*pi)/ TICK_ROTATE )]) # Rotate by 90 deegres
self.state_helper *= -1
return self.command_queue.pop(0)
if self.state == Turner.STATE_SCANNING:
x_disc, y_disc = int(self.x + 0.5), int(self.y + 0.5)
# +0.5 because axis origin is in the middle of a field
print "Scanning on ",x_disc, " ",y_disc
import math
# Determine vector in which direction we are scanning
vector = (math.cos((self.angle - 90.0)/180.0 * pi), \
math.sin((self.angle - 90.0)/180.0 * pi))
dataset = DenseDesignMatrix(X=X_train, y=Y_train[:,11:12].reshape(-1,1).astype("int64"))
hidden_layer = mlp.Sigmoid(layer_name='hidden', dim=1000, sparse_init =15, init_bias=1.)
output_layer = mlp.Softmax(n_classes=1, sparse_init =1, layer_name='output')
layers = [hidden_layer, output_layer]
ann = mlp.MLP(layers, nvis=X_train.shape[1])
trainer = sgd.SGD(
learning_rate=.05, batch_size=250, termination_criterion=EpochCounter(10), monitoring_dataset=dataset)
trainer.setup(ann,dataset)
while True:
@kudkudak
kudkudak / gist:7dfb6d3e7a1305b7b5b5
Last active August 29, 2015 14:10
Parse meto data
import pandas as pd
import numpy as np
def get_city_meteo(city):
a = [pd.read_csv(os.path.join(c["DATA_DIR"], str(city)+"-201"+str(i)+".csv"), sep=",") for i in range(4)]
csv = pd.concat(a)
# Do simple transformations
columns = ["date_year", "date_month", "date_day", "date_hour", "cloud_amount", "pressure", "temperature", "wind_speed", "percipitation_amount"]
csv.index = range(len(csv))
csv = csv[columns]
import odespy
import numpy as np
dt = np.float64
mu = dt(1.0)/dt(82.45)
lamb = dt(1.0) - mu
def gprim_1(t,z):
return z[1]
In file included from cec/kmeanspp_assignment.cpp:1:
In file included from ../inst/include/cec/kmeanspp_assignment.hpp:4:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list:178:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:685:97: error: invalid operands to binary expression ('const gmum::Pair' and 'const gmum::Pair')
_LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
~~~ ^ ~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list:2188:13: note: in instantiation of member function 'std::__1::__less<gmum::Pair, gmum::Pair>::operator()' requested here
if (__comp(*--__e2, *__f1))
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault
# coding: utf-8
## Praktyczny Machine Learning w Pythonie
### Czy wszystko jest poprawnie zainstalowane?
# In[14]:
import matplotlib.pylab as plt # pakiet do rysowania
import numpy as np # pakiet do manipulacji macierzami
import sklearn # scikit-learn, który będzie podstawowym tematem dzisiejszych warsztatów
- przypomnienie lub wprowadzenie do sieci feedforward i ich trenowanie przy pomocy stochastic gradient descent
- sieci konwolucyjnych (CNN):
- local connectivity
- parameter sharing
- convolution
- pooling / subsampling
- trenowanie CNN
- zastosowanie CNN w computer vision
- object recognition
- deep rank
Protein: 5ht1a
Satisfied? Not satisfied
Sizes of clusters [5669, 6, 12, 30, 11, 3]
-----
Protein: 5ht2a
Satisfied? Not satisfied
Sizes of clusters [2828, 191, 29, 55, 11, 6, 2]
-----