Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mamei16 committed Aug 9, 2019
2 parents 51d5f3e + adc62b3 commit ce3075b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Exercise2.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[' ', '#', ' ', ' ', ' '],
[' ', '#', ' ', ' ', ' ']]

environment = complex_environment
environment = simple_environment

#Dimensions of the environment
COLUMNS = len(environment[0])
Expand All @@ -34,7 +34,7 @@
action_selected_matrix = [[-1 for x in range(COLUMNS)] for y in range(ROWS)]
step_size = 0.1 # Alpha
discount_rate = 0.9 # Gamma
epsilon = 0.1 # ϵ for greedy
epsilon = 1 # ϵ for greedy
episode_amount = 100
reward_for_each_episode = [0 for x in range(episode_amount)]
index = 0
Expand Down
26 changes: 21 additions & 5 deletions NN/Perceptron.m
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
T = now;
rng(T)


bias = 0;
u = [bias, 0,0; bias,0,1; bias,1,0; bias,1,1]
u = [bias, 0,0; bias,0,1; bias,1,0; bias,1,1];
v = 0;
t = [0, 0, 0, 1];
weigths = -1 + (1+1)*rand(1,2)
w = [-1, weigths]
weigths = -1 + (1+1)*rand(1,2);
w = [-1, weigths];
error = inf;
epochs = 1000;

while error > 0.001
u
for epoch = 1:epochs
matrix_input_output = [u,t'];
Shuffle(matrix_input_output);
matrix_input_output
t = matrix_input_output(:,end)';
u = matrix_input_output(:, 1:end-1);
for i = 1:4
input_vector = u(i,:);
correct_output = t(i);
end
end
end
5 changes: 5 additions & 0 deletions NN/Shuffle.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function v=shuffle(v)
rng shuffle
v=v(randperm(length(v)));
end

Binary file modified Presentation/SDU_SummerSchool_Presentation.pptx
Binary file not shown.

0 comments on commit ce3075b

Please sign in to comment.