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
年 | 台灣事故件數(件) | 台灣死亡人數(人) | 台灣受傷人數(人) | 日本事故件數(件) | 日本死亡人數(人) | 日本受傷人數(人) | |
---|---|---|---|---|---|---|---|
2008 | 170127 | 3474 | 226192 | 766394 | 5209 | 945703 | |
2009 | 184749 | 3232 | 245837 | 737637 | 4979 | 911215 | |
2010 | 219651 | 3297 | 292535 | 725924 | 4948 | 896297 | |
2011 | 235776 | 3343 | 314004 | 692084 | 4691 | 854613 | |
2012 | 249465 | 3219 | 332942 | 665157 | 4438 | 825392 | |
2013 | 278388 | 3072 | 372443 | 629033 | 4388 | 781492 | |
2014 | 307842 | 3075 | 412010 | 573842 | 4113 | 711374 | |
2015 | 305413 | 2942 | 408860 | 536899 | 4117 | 666023 | |
2016 | 305556 | 2847 | 402699 | 499201 | 3904 | 618853 |
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
import torch | |
import torch.nn.functional as F | |
def maml_grad(model, inputs, outputs, lr, batch=1): | |
""" | |
Update a model's gradient using MAML. | |
The gradient will point in the direction that | |
improves the total loss across all inner-loop |
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
// An example of using the PyTorch C++ API to implement a custom forward and backward function | |
#include <iostream> | |
#include <vector> | |
#include <torch/torch.h> | |
#include <torch/csrc/autograd/variable.h> | |
#include <torch/csrc/autograd/function.h> | |
#include <torch/csrc/autograd/VariableTypeUtils.h> | |
#include <torch/csrc/autograd/functions/utils.h> |
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
''' | |
Memory profiling utilities | |
''' | |
import gc | |
import inspect | |
import linecache | |
import os.path | |
import sys | |
import time | |
import threading |
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 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
# How to apply exponential moving average decay for variables? | |
# https://discuss.pytorch.org/t/how-to-apply-exponential-moving-average-decay-for-variables/10856/2 | |
class EMA(nn.Module): | |
def __init__(self, mu): | |
super(EMA, self).__init__() | |
self.mu = mu | |
def forward(self,x, last_average): | |
new_average = self.mu*x + (1-self.mu)*last_average | |
return new_average |
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
#!/bin/bash | |
# Sets each CUDA device to persistence mode and sets the application clock | |
# and power limit to the device's maximum supported values. | |
# When run with "--dry-run" as first command line argument or not as superuser, | |
# will display the commands, otherwise it will execute them. | |
# | |
# Hint: To run this at boot time, place this script in /root and create a file | |
# /etc/cron.d/nvidia_boost with the following single line: | |
# @reboot root /root/nvidia_boost.sh >/dev/null | |
# |
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
/* | |
Super Easy Diy Drumpad Example | |
GIT: https://gist.github.com/billju/ce1337ea3c1dbb4341ce22dca1b55442 | |
2017 by Billju | |
Inspired by Evan Kale | |
*/ | |
#include <Keyboard.h> | |
#include "MIDIUSB.h" |
NewerOlder