This content has moved.
Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!
import openai | |
class ChatGPT: | |
""" A very simple wrapper around OpenAI's ChatGPT API. Makes it easy to create custom messages & chat. """ | |
def __init__(self, model="gpt-3.5-turbo", completion_hparams=None): | |
self.model = model | |
self.completion_hparams = completion_hparams or {} | |
self.history = [] | |
self._messages = [] |
from concurrent.futures import as_completed, ProcessPoolExecutor | |
import geopandas as gpd | |
import pandas as pd | |
import numpy as np | |
from collections.abc import Sequence | |
from shapely import prepared | |
def sjoin(left_df, right_df, op='intersects', how='inner', lsuffix='left', rsuffix='right', fail_crs_mismatch: bool = True, fail_missing_geometries: bool = False) -> gpd.GeoDataFrame: | |
"""Spatial join of two GeoDataFrames. GeoPandas sjoin with concurrency (split naively using df slicing). | |
package main | |
import ( | |
"fmt" | |
"github.com/aws/aws-sdk-go/aws" | |
"github.com/aws/aws-sdk-go/aws/session" | |
"github.com/aws/aws-sdk-go/service/ssm" | |
) |
This content has moved.
Please go to bagder/TRRprefs for the current incarnation of the docs, and please help us out polish and maintain this documentation!
'''This script goes along the blog post | |
"Building powerful image classification models using very little data" | |
from blog.keras.io. | |
It uses data that can be downloaded at: | |
https://www.kaggle.com/c/dogs-vs-cats/data | |
In our setup, we: | |
- created a data/ folder | |
- created train/ and validation/ subfolders inside data/ | |
- created cats/ and dogs/ subfolders inside train/ and validation/ | |
- put the cat pictures index 0-999 in data/train/cats |
#!/bin/bash | |
# Run this on This AMI on AWS: | |
# https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#LaunchInstanceWizard:ami=ami-b36981d8 | |
# You should get yourself a fully working GPU enabled tensorflow installation. | |
cd ~ | |
# grab cuda 7.0 |
""" | |
An example to check the AUC score on a validation set for each 10 epochs. | |
I hope it will be helpful for optimizing number of epochs. | |
""" | |
# -*- coding: utf-8 -*- | |
import logging | |
from sklearn.metrics import roc_auc_score | |
from keras.callbacks import Callback |
from numpy import * | |
from scipy.stats import beta | |
class BetaBandit(object): | |
def __init__(self, num_options=2, prior=(1.0,1.0)): | |
self.trials = zeros(shape=(num_options,), dtype=int) | |
self.successes = zeros(shape=(num_options,), dtype=int) | |
self.num_options = num_options | |
self.prior = prior |
#!/usr/bin/env python | |
"""Reads json lines from stdin and write csv to stdout. | |
Usage: | |
json2csv.py -f <field>... | |
json2csv.py -h | --help | |
json2csv.py --version | |
Options: | |
-h --help Show this screen. |