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
setwd("~/Desktop/R-tutorial/") | |
#### | |
# Mapping example | |
#### | |
# load packages | |
require(rgdal) | |
require(raster) | |
require(leaflet) |
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
def binary_crossentropy_with_ranking(y_true, y_pred): | |
""" Trying to combine ranking loss with numeric precision""" | |
# first get the log loss like normal | |
logloss = K.mean(K.binary_crossentropy(y_pred, y_true), axis=-1) | |
# next, build a rank loss | |
# clip the probabilities to keep stability | |
y_pred_clipped = K.clip(y_pred, K.epsilon(), 1-K.epsilon()) |
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
bazel build -c opt --copt=-mavx --copt=-mavx2 --copt=-mfma --copt=-msse4.2 //tensorflow/tools/pip_package:build_pip_package |
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
# Example use of function calling to return structured data from GPT API | |
import asyncio | |
import json | |
import os | |
import sys | |
import openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") |