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 'package:flutter/material.dart'; | |
import 'package:speech_to_text/speech_recognition_error.dart'; | |
import 'package:speech_to_text/speech_recognition_result.dart'; | |
import 'package:speech_to_text/speech_to_text.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
from itertools import permutations | |
def solution(board, r, c): | |
answer = float('inf') | |
n_set = set() | |
for row in board: | |
for el in row: | |
n_set.add(el) | |
def compute_needed_move(dst, r,c): |
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
from collections import defaultdict, deque | |
def solution(edges): | |
graph = defaultdict(list) | |
for (n1, n2) in edges: | |
graph[n1].append(n2) | |
graph[n2].append(n1) | |
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
""" | |
ref : https://ccurity.tistory.com/231 | |
""" | |
import datetime | |
import time | |
import pyautogui as m | |
import schedule | |
import argparse |
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
def _wider_conv(self, teacher_w1, teacher_b1, teacher_w2, width_coeff, verification): | |
new_width = int(width_coeff * teacher_w1.shape[3]) | |
rand = np.random.randint(teacher_w1.shape[3], size=(new_width - teacher_w1.shape[3])) | |
replication_factor = np.bincount(rand) | |
student_w1 = teacher_w1.copy() | |
student_w2 = teacher_w2.copy() | |
student_b1 = teacher_b1.copy() | |
# target layer update (i) | |
for i in range(len(rand)): | |
teacher_index = rand[i] |
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
ctpu up --noconf --preemptible --zone=us-central1-f --tf-version=1.15.3 --name=incremental-scale-width-232-1-0 -tpu-only & | |
sleep 15 | |
ctpu up --noconf --preemptible --zone=us-central1-f --tf-version=1.15.3 --name=incremental-scale-width-232-2-0 -tpu-only & | |
sleep 15 | |
ctpu up --noconf --preemptible --zone=us-central1-f --tf-version=1.15.3 --name=incremental-scale-width-232-3-0 -tpu-only & | |
sleep 15 | |
ctpu up --noconf --preemptible --zone=us-central1-f --tf-version=1.15.3 --name=incremental-scale-width-232-4-0 -tpu-only & | |
sleep 15 | |
ctpu up --noconf --preemptible --zone=us-central1-f --tf-version=1.15.3 --name=incremental-scale-width-232-5-0 -tpu-only & | |
sleep 15 |
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
#compound scaling | |
scale_coeff = [0.5, 1.0, 1.5] | |
for coeff in scale_coeff: | |
print(a ** coeff, b**(coeff) , c**(coeff)) | |
#1.0954451150103321 1.0488088481701516 1.0723805294763609 | |
#1.2 1.1 1.15 | |
#1.3145341380123985 1.153689732987167 1.2332376088978148 | |
# W scaling | |
alpha = .8 |
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
from __future__ import print_function | |
import argparse | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torchvision import datasets, transforms | |
from torch.optim.lr_scheduler import StepLR | |
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
""" | |
most code from | |
https://colab.research.google.com/github/pytorch/xla/blob/master/contrib/colab/mnist-training.ipynb#scrollTo=pTmxZL5ymp8P | |
""" | |
import math | |
from matplotlib import pyplot as plt | |
M, N = 4, 6 | |
RESULT_IMG_PATH = '/tmp/test_result.png' |
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
from multiprocessing import Process, Pipe | |
import time | |
remotes, work_remotes = zip(*[Pipe() for _ in range(10)]) | |
def worker(remote, parent_remote): | |
parent_remote.close() | |
print(f"closed {id(parent_remote)}, {time.time()}") | |
# print(f"In worker : {id(remotes[0])} is closed. {remotes[0].closed}") |
NewerOlder