This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" MIT License """ | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from bokeh.plotting import figure, show, output_file, save | |
from bokeh.embed import file_html, components | |
from bokeh.resources import CDN | |
X = np.array([0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 12, 13, 14, 15], dtype=np.float32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from Queue import Queue | |
def bfs(instance): | |
closed = set() # zbiór zamknięty | |
#inicjujemy zbiór otwarty stanem początkowym. Decyzję ustawiamy na null | |
#koszt na 0 - nie ma to znaczenia. Rodzicem jest również null (jest to | |
#korzeń drzewa | |
#fringe dla BFS jest kolejką | |
#enqueue - put |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
def dfs(instance): | |
closed = set() # zbiór zamknięty | |
#inicjujemy zbiór otwarty stanem początkowym. Decyzję ustawiamy na null | |
#koszt na 0 - nie ma to znaczenia. Rodzicem jest również null (jest to | |
#korzeń drzewa | |
#formalnie jest to lista, ale jest używana jako stos | |
#pop - pop | |
#push - append | |
fringe = [[(instance.get_start_state(), None, 0), None]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
The Art of an Artificial Intelligence | |
http://art-of-ai.com | |
https://github.com/artofai | |
""" | |
__author__ = 'xevaquor' | |
__license__ = 'MIT' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Perceptron(object): | |
def __init__(self, initial_weights=None): | |
self.w = initial_weights | |
self.training_error = None | |
def activation(self, v): | |
return v > 0 | |
def train_perceptron(self, TrainingData, learning_rate=0.05, | |
iterations=2000, callback_frequency=10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MAX(placa_pod) as maximum, MIN(placa_pod) as minimum, MAX(placa_pod) - MIN(placa_pod) as roznica FROM pracownicy | |
select etat, avg(PLACA_POD) as srednia FROM pracownicy GROUP BY etat ORDER BY srednia desc | |
select count(*) from pracownicy where etat = 'PROFESOR' | |
select ID_ZESP, SUM(placa_pod + NVL(placa_dod, 0)) as sumaryczne_place from pracownicy group by id_zesp | |
select MAX(SUM(placa_pod + NVL(placa_dod, 0))) as max_sumaryczne_place from pracownicy group by id_zesp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$MOD52 | |
JMP START | |
ORG 0003H | |
;MOV P2, #00000111B | |
INC A | |
CALL DELAY | |
RETI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
class DomainException(Exception): | |
pass | |
class Colour(object): | |
def __init__(self): | |
pass | |
Red, Green, Blue = range(3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
class DomainException(Exception): | |
pass | |
class Variable(object): | |
def __init__(self, fixed_value=None): | |
# załpżono, że dziedzina dla wszystkich zmiennych jest taka sama [1..20] | |
# ale równie dobrze może być przekazywana do konstruktora | |
self.domain = range(1,21) if fixed_value is None else [fixed_value] | |
self._value = fixed_value |
NewerOlder