This file contains hidden or 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 | |
from opytimizer import Opytimizer | |
from opytimizer.functions import ConstrainedFunction | |
from opytimizer.optimizers.swarm import PSO | |
from opytimizer.spaces import SearchSpace | |
# Defines a customized objective function | |
def spfunc(x): | |
# Just a mock-up objective to emulate the problem |
This file contains hidden or 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 pandas as pd | |
from pokemontcgsdk import Card, Set | |
# Sets to be searched | |
SETS = ['g1', 'sm1', 'sm2', 'sm4', 'sm6', 'sm7', | |
'sm11', 'sm12', 'swsh1', 'swsh2', 'swsh3', 'swsh4'] | |
# Instantiates an array of cards from all sets | |
cards_sets = np.zeros((894, len(SETS))) |
This file contains hidden or 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
#!/bin/bash | |
# User to enter the host | |
USER=username | |
# Script to run in host | |
# In this case, we will be dumping the process my memory usage order | |
SCRIPT="ps aux --sort -%mem" | |
# List of hosts |
This file contains hidden or 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
% Function to be plotted | |
z = @(x,y) (sin(x) * sqrt(x)) * (sin(y) * sqrt(y)); | |
% Plots the function | |
h = fsurf(z,[0 10]); | |
% Defines some attributes on its positioning and brightness | |
camlight(110,70) | |
brighten(0.7) | |
h.EdgeColor = 'none'; |
This file contains hidden or 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
from opytimizer import Opytimizer | |
from opytimizer.core.function import Function | |
from opytimizer.optimizers.abc import ABC | |
from opytimizer.spaces.search import SearchSpace | |
from sklearn.manifold import TSNE | |
import word2vec | |
# Loading word2vec word embeddings | |
w2v = word2vec.load_word_vectors() |
This file contains hidden or 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
from math import pi, sin | |
import numpy as np | |
def function(x): | |
"""Fitness function. | |
Args: | |
x (float): Input value for fitness function. |
This file contains hidden or 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
from math import pi, sin | |
import numpy as np | |
def function(x): | |
"""Fitness function. | |
Args: | |
x (float): Input value for fitness function. |
This file contains hidden or 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 utils as u | |
class ACO: | |
"""An Ant-Colony Optimization implementation. | |
""" |
This file contains hidden or 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
% Check this repository to create your own MNIST Matlab's matrix | |
% https://github.com/daniel-e/mnist_octave/ | |
% Loading MNIST matrix file | |
load('mnist.mat'); | |
% Creating an empty array of 100 samples | |
A = zeros(28, 28, 1, 100, 'uint8'); | |
% Looping through 100 random samples |
This file contains hidden or 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 time | |
import requests | |
from bs4 import BeautifulSoup | |
# Youtube channel URL | |
url = 'https://www.youtube.com/channel/UCTCykZFeSbgMuL2ZzhSyVzg' | |
# Sleeping time | |
sleep_time = 5 |