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
visualize <- function(data, c1='white', c2='#779ecb') { | |
data %>% | |
ggplot(aes(x=x, y=y, fill = factor(z))) + | |
geom_raster() + | |
scale_fill_manual(breaks = levels(factor(data$z)), | |
values = c(c1, c2)) + | |
theme(legend.position = 'none', | |
axis.text = element_blank(), | |
axis.title = element_blank(), | |
axis.ticks = element_blank(), |
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
library(ggplot2) | |
library(tidyverse) | |
Rule30 <- function(half_len, iterations) { | |
# Functional Rules | |
half_len <- 2*half_len | |
a = c('111', '110', '101', '100', '011', '010', '001', '000') |
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
library(ggplot2) | |
library(tidyverse) | |
Rule30 <- function(half_len, iterations) { | |
# Functional Rules | |
half_len <- 2*half_len | |
a = c('111', '110', '101', '100', '011', '010', '001', '000') |
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
library(ggplot2) | |
library(tidyverse) | |
Rule30 <- function(half_len, iterations) { | |
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
colours = [['R','G','G','R','R'], | |
['R','R','G','R','R'], | |
['R','R','G','G','R'], | |
['R','R','R','R','R']] | |
measurements = ['G','G','G','G','G'] | |
motions = [[0,0],[0,1],[1,0],[1,0],[0,1]] | |
localization = localization(colours=colours, measurements=measurements, motions=motions, sensor_right=0.7, p_move=0.8) | |
posterior = localization.compute_posterior() | |
localization.show(posterior) |
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 localization(): | |
"""Performing Bayesian Updating to Produce a Distribution of Likely Positions in the Environment""" | |
def __init__(self, colours, measurements, motions, sensor_right, p_move): | |
self.world = colours | |
self.measurements = measurements | |
self.motions = motions | |
self.sensor_right = sensor_right | |
self.p_move = p_move |
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
# generate random Gene sequence | |
def generateParent(length): | |
genes = list("") | |
for i in range(0,length): | |
geneIndex = np.random.randint(0, len(geneset) -1); | |
genes.append(geneset[geneIndex]) | |
return(''.join(genes)) | |
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
import numpy as np | |
import datetime | |
import time | |
# Encode Binary | |
# genotypical_phenotype_latent_representation = bin(int.from_bytes(target.encode(), 'big')) | |
geneset = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!." | |
def stochastic_decryption_oscillator(): |
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
#__________________________________ Required libraries ______________________________________ | |
library(rtweet) | |
library(dplyr) | |
library(tidytext) | |
library(tidyr) | |
library(NLP) | |
library(syuzhet) | |
library(tm) |
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
#__________________________________ Required libraries ______________________________________ | |
library(rtweet) | |
library(dplyr) | |
library(tidytext) | |
library(tidyr) | |
library(NLP) | |
library(syuzhet) | |
library(tm) | |
library(SnowballC) | |
library(stringi) |
NewerOlder