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
# Pseudocode for Simulated Annealing Algorithm | |
while t_new > stopping temp: | |
for number of runs at each temp: | |
x_new, y_new = random neighboring value of x_old, y_old | |
calculate the cost c_new of this neighboring solution | |
if c_new – c_old >= 0: | |
This is a better solution, so move to it | |
else: | |
Calculate the probability of moving to the new worse solution |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Module for implementing Simulated Annealing algorithm for single objective optimization. | |
author := "Daniel Barker" | |
""" | |
import random |
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
value | ||
---|---|---|
2018-08-20 12:05:10.000000 | 0 | |
2018-08-20 12:05:19.888677 | 1 | |
2018-08-20 12:05:24.758246 | 1 | |
2018-08-20 12:05:25.584516 | 0 | |
2018-08-20 12:05:32.897718 | 1 | |
2018-08-20 12:05:36.799978 | 1 | |
2018-08-20 12:05:44.782406 | 1 | |
2018-08-20 12:05:45.493593 | 0 | |
2018-08-20 12:05:52.628990 | 1 |
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 the FloodScraper Module | |
from FloodScraper import FloodScraper | |
# User inputs | |
gage_number = 520 | |
reported_from = '09/02/2017 07:31:00 AM' | |
last = '6 Hours' | |
# Create scraper interest and run a query | |
scraper = FloodScraper() |
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 the FloodScraper Module | |
from FloodScraper import FloodScraper | |
# User inputs | |
gage_number = 520 | |
reported_from = '09/02/2017 07:31:00 AM' | |
last = '7 Days' | |
filename = 'gage_data.json' | |
# Create scraper interest and run a query |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
from FloodScraper import FloodScraper | |
# User Inputs | |
gage_number = 475 | |
reported_from = '09/02/2017 07:31:00 AM' | |
last = '7 Days' | |
# Create scraper interest and run a query |
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
#!/usr/bin/env bash | |
# ---------------------------- INSTALL NOTES ---------------------------- | |
# To properly setup the AWS CLI, make sure that this shell script is run with the two required positional args: | |
# $1 :: (string) AWS Access Key ID | |
# $2 :: (string) AWS Secret Key | |
# | |
# Also make sure to give the script permission to run!: | |
# chmod 755 /home/ec2-user/install.sh | |
# |
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 pandas as pd | |
import matplotlib.pyplot as plt | |
import matplotlib.dates as mdates | |
# if your dates are strings you need this step | |
df.Date = pd.to_datetime(df.Date) | |
fig,ax = plt.subplots() | |
ax.plot_date(df.Date,df.A) | |
ax.plot_date(df.Date,df.B) |
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
""" | |
@author: dcbark01 | |
@date: Nov 2019 | |
@license: MIT | |
""" | |
import os | |
import json | |
import shlex | |
import subprocess |
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
def pretty_size(size): | |
"""Pretty prints a torch.Size object""" | |
assert(isinstance(size, torch.Size)) | |
return " × ".join(map(str, size)) | |
def bytes2human(n, format='%(value).1f %(symbol)s', symbols='customary'): | |
""" | |
Convert n bytes into a human readable string based on format. | |
symbols can be either "customary", "customary_ext", "iec" or "iec_ext", |