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 osmnx as ox | |
import matplotlib.pyplot as plt | |
from pathlib import Path | |
AMENITY_QUERIES = [ | |
("bank", {"amenity": "bank"}), | |
("bar", {"amenity": ["bar", "pub"]}), | |
("coffee shop", {"amenity": "cafe", "cuisine": "coffee_shop"}), | |
( |
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
# courtesy of Mason Protter on the Julia Slack | |
@generated function structintersect(a::NamedTuple{a_names}, b::NamedTuple{b_names}) where {a_names, b_names} | |
names = Tuple(intersect(a_names, b_names)) | |
fields = Expr(:tuple, (:(getproperty(a, $(QuoteNode(name))), getproperty(b, $(QuoteNode(name)))) for name in names)...) | |
quote | |
NamedTuple{$names}($fields) | |
end | |
end |
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
using Flux | |
include("weights.jl") | |
function gradtezt(x, weight, bias, act=selu) | |
gx = gpu(x) | |
ctc = ConvTranspose(weight, bias, act, groups=5) | |
gtc = gpu(ctc); | |
yc = Flux.withgradient(() -> sum(ctc(x)), params(ctc)) |> first | |
yg = Flux.withgradient(() -> sum(gtc(gx)), params(gtc)) |> first |
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
# Classifies MNIST digits with a convolutional network. | |
# Writes out saved model to the file "mnist_conv.bson". | |
# Demonstrates basic model construction, training, saving, | |
# conditional early-exit, and learning rate scheduling. | |
# | |
# This model, while simple, should hit around 99% test | |
# accuracy after training for approximately 20 epochs. | |
using Flux, MLDatasets, Random, Statistics | |
using Flux: unsqueeze, onehotbatch, onecold, logitcrossentropy |
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 12 columns, instead of 10 in line 5.
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
ACCURATE_EPISODE_DATE,Age_Group,CLIENT_GENDER,CASE_ACQUISITIONINFO,RESOLVED,Reporting_PHU,Reporting_PHU_Address,Reporting_PHU_City,Reporting_PHU_Postal_Code,Reporting_PHU_Website,Reporting_PHU_Latitude,Reporting_PHU_Longitude | |
2020-01-21,50s,MALE,Travel-Related,Yes,Toronto Public Health,"277 Victoria Street, 5th Floor",Toronto,M5B 1W2,www.toronto.ca/community-people/health-wellness-care/,43.65659125,-79.37935801 | |
2020-01-22,50s,FEMALE,Travel-Related,Yes,Toronto Public Health,"277 Victoria Street, 5th Floor",Toronto,M5B 1W2,www.toronto.ca/community-people/health-wellness-care/,43.65659125,-79.37935801 | |
2020-01-24,20s,FEMALE,Travel-Related,Yes,Middlesex-London Health Unit,50 King Street,London,N6A 5L7,www.healthunit.com,42.98146842,-81.25401572 | |
2020-01-25,50s,MALE,Neither,Yes,Ottawa Public Health,100 Constellation Drive,Ottawa,K2G 6J8,www.ottawapublichealth.ca,45.3456651,-75.7639122 | |
2020-02-05,20s,FEMALE,Travel-Related,Yes,Toronto Public Health,"277 Victoria Street, 5th Floor",Toronto,M5B 1W2,www.toronto.ca/commun |