Skip to content

Instantly share code, notes, and snippets.

View DwyaneShi's full-sized avatar

Haiyang Shi DwyaneShi

  • the Ohio State University
  • Columbus, OH
View GitHub Profile
@DwyaneShi
DwyaneShi / raysgd_sage.py
Created July 27, 2021 23:45
Code snippets for performance-issue-of-back-propagation-in-using-raysgd/3042
def load_subtensor(g_features, g_labels, seeds, input_nodes, device):
batch_inputs = g_features[input_nodes].to(device)
batch_labels = g_labels[seeds].to(device)
return batch_inputs, batch_labels
class NeighborSampler(object):
def __init__(self, g, fanouts, sample_neighbors, device):
self.g = g
self.fanouts = fanouts
@DwyaneShi
DwyaneShi / download_and_preprocess_imagenet.patch
Created October 18, 2018 03:18
A patch enables to preprocess existing ImageNet tarballs on disk
diff --git a/research/inception/inception/data/download_and_preprocess_imagenet.sh b/research/inception/inception/data/download_and_preprocess_imagenet.sh
index 6faae83..1f630ea 100755
--- a/research/inception/inception/data/download_and_preprocess_imagenet.sh
+++ b/research/inception/inception/data/download_and_preprocess_imagenet.sh
@@ -56,7 +56,7 @@ fi
# Create the output and temporary directories.
DATA_DIR="${1%/}"
SCRATCH_DIR="${DATA_DIR}/raw-data/"
-mkdir -p "${DATA_DIR}"
+# mkdir -p "${DATA_DIR}"
@DwyaneShi
DwyaneShi / disable.sh
Created July 13, 2018 20:43
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi