Skip to content

Instantly share code, notes, and snippets.

View logankilpatrick's full-sized avatar
🤹
Juggling many things - please be patient

Logan Kilpatrick logankilpatrick

🤹
Juggling many things - please be patient
View GitHub Profile
View generate_passwords.jl
# Generate Passwords in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
using ProgressBars
using Random
# WARNING: Do not use this code to generate actual passwords!
function generate_passwords()
num_passwords = parse(Int64, Base.prompt("How many passwords do you want to generate?"))
password_length = parse(Int64, Base.prompt("How long should each password be?"))
View rock_paper_scissors.jl
# Rock 🗿, Paper 📃, Scissors ✂️ Game in Julia
function play_rock_paper_scissors()
moves = ["🗿", "📃", "✂️"]
computer_move = moves[rand(1:3)]
# Base.prompt is similar to readline which we used before
human_move = Base.prompt("Please enter 🗿, 📃, or ✂️")
# Appends a ": " to the end of the line by default
View number_guess_computer.jl
# Computer Number Guessing Game in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
using Random
function play_number_guess_computer()
print("Please enter a number between 1 and 50 for the computer to try and guess: ")
# Take in the user input and convert it to a number
View number_guess_human.jl
# Number Guessing Game in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
function play_number_guess_human()
total_numbers = 25 #
# Generate a random number within a certain range
target_number = rand(1:total_numbers)
guess = 0
View madlibs.jl
# Mad Libs in Julia
# Source: https://github.com/logankilpatrick/10-Julia-Projects-for-Beginners
function play_mad_libs()
print("Enter a verb (action): ")
verb1 = readline()
print("Enter an adjective (descriptive word): ")
adj1 = readline()
@logankilpatrick
logankilpatrick / dense.py
Created November 7, 2021 16:22
Create a model in Tensorflow with a variable number of dense layers
View dense.py
import os
import sys
import numpy as np
from tensorflow.keras import models, layers
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
# Change this to the location of the database directories
DB_DIR = os.path.dirname(os.path.realpath(__file__))
@logankilpatrick
logankilpatrick / cnn_model.py
Created November 7, 2021 16:21
Train a basic CNN Model with a Convolutional, Maxpooling, Flatten, and Dense layers in Tensorflow
View cnn_model.py
import os
import sys
import numpy as np
from tensorflow.keras import models, layers, callbacks
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
# Change this to the location of the database directories
DB_DIR = os.path.dirname(os.path.realpath(__file__))
@logankilpatrick
logankilpatrick / cnn_model_with_transformations.py
Created November 7, 2021 16:20
Train a basic CNN model in Tensorflow / Keras with Image Transformations / Augmentations like padding, zoom, crop, etc.
View cnn_model_with_transformations.py
import os
import sys
import numpy as np
from tensorflow.keras import models, layers, callbacks
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
from matplotlib import pyplot as plt
# Change this to the location of the database directories
@logankilpatrick
logankilpatrick / RELU.py
Created November 7, 2021 16:18
Train a leaky RELU and Vanilla RELU on the MNIST dataset with Tensorflow
View RELU.py
import os
import sys
from typing import Counter
import tensorflow as tf
import numpy as np
from tensorflow.keras import models, layers, callbacks
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
from matplotlib import pyplot as plt
@logankilpatrick
logankilpatrick / LSTM.py
Created November 7, 2021 16:16
Train an LSTM/GRU/Simple RNN Model with a TimeDistributed layer on a speech_recognition DataSet Tensorflow
View LSTM.py
import os
import sys
import numpy as np
import tensorflow as tf
from tensorflow.keras import models, layers, callbacks
from tensorflow.keras.utils import to_categorical
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.datasets import mnist
# Change this to the location of the database directories