国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
"""Functions for working with remote files using pandas and paramiko (SFTP/SSH).""" | |
import pandas as pd | |
import paramiko | |
def read_csv_sftp(hostname: str, username: str, remotepath: str, *args, **kwargs) -> pd.DataFrame: | |
""" | |
Read a file from a remote host using SFTP over SSH. | |
Args: |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
from __future__ import print_function, absolute_import | |
__all__ = ['accuracy'] | |
def accuracy(output, target, topk=(1,)): | |
"""Computes the precision@k for the specified values of k""" | |
maxk = max(topk) | |
batch_size = target.size(0) | |
_, pred = output.topk(maxk, 1, True, True) |
# -*- coding: utf-8 -*- | |
import logging | |
import os | |
import datetime | |
import time | |
class SingletonType(type): | |
_instances = {} |
Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/
#cython: boundscheck=False, wraparound=False | |
import numpy as np | |
cimport numpy as np | |
from cython.parallel cimport prange | |
def dot(np.ndarray[np.float32_t, ndim=2] a not None, | |
np.ndarray[np.float32_t, ndim=2] b not None, | |
np.ndarray[np.float32_t, ndim=2] out=None): | |
"""Naive O(N**3) 2D np.dot() implementation.""" |