Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 torch.nn as nn | |
import pytorch_nns.helpers as h | |
import pytorch_nns.functional as f | |
# | |
# HELPERS | |
# | |
def category_weights( | |
count_dict, | |
total=None, |
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 numpy as np | |
import tensorflow as tf | |
import keras.backend as K | |
def weighted_categorical_crossentropy(weights): | |
""" weighted_categorical_crossentropy | |
Args: | |
* weights<ktensor|nparray|list>: crossentropy weights |
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 itertools | |
from multiprocessing import Process, cpu_count | |
from multiprocessing import Pool | |
from multiprocessing.pool import ThreadPool | |
# | |
# CONFIG | |
# | |
MAX_POOL_PROCESSES=cpu_count()-1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from __future__ import print_function | |
import re | |
import click | |
import rasterio | |
CLR_IDENT='clr' | |
CMAP={ | |
1: (48, 124, 38), | |
2: (138, 216, 168), |
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 sys | |
import httplib2 | |
from googleapiclient import discovery | |
from oauth2client.client import GoogleCredentials | |
from oauth2client.service_account import ServiceAccountCredentials | |
from apiclient.http import MediaFileUpload | |
KEY_FILE='/.config/gclib/sa_key.json' | |
FT_SCOPE = 'https://www.googleapis.com/auth/fusiontables' | |
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive' |