Skip to content

Instantly share code, notes, and snippets.

@spikebike
spikebike / client.go
Created March 29, 2012 01:13
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@vene
vene / lbfgs_l1logistic.py
Last active January 14, 2023 20:30
Solving L1-regularized problems with l-bfgs-b
"""l-bfgs-b L1-Logistic Regression solver"""
# Author: Vlad Niculae <[email protected]>
# Suggested by Mathieu Blondel
from __future__ import division, print_function
import numpy as np
from scipy.optimize import fmin_l_bfgs_b
@fasionchan
fasionchan / pyconsole.py
Last active February 4, 2025 12:49
Python 远程交互式终端
import code
import threading
import sys
from io import StringIO
from xmlrpc.client import ServerProxy
from xmlrpc.server import SimpleXMLRPCServer
class OutputHookContext:
addmm(bias, input, weight)
bias: replicated
output = input * weight
input shard(1), weight, shard(0) -> partial tensor
output -> partial -> replicated?
output + bias -> partial? only do on one rank