Skip to content

Instantly share code, notes, and snippets.

View creotiv's full-sized avatar

Andrey Nikishaev creotiv

View GitHub Profile
@creotiv
creotiv / MLRunner.md
Last active April 15, 2021 09:41
Script to run ml code from git in parallel without changing branch

Use

./ml.sh -b master python3 test.py

sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo usermod -a -G docker $USER
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az login --identity
resource "azurerm_storage_account" "funcsta" {
name = "${local.storage_account_name}"
resource_group_name = "${var.resource_group_name}"
location = "${var.location}"
account_tier = "Standard"
account_replication_type = "${var.account_replication_type}"
enable_blob_encryption = "true"
enable_file_encryption = "true"
tags = "${merge(var.tags, map("environment", var.environment), map("release", var.release))}"
#Main function
Function GetWin8Key
{
$Hklm = 2147483650
$Target = $env:COMPUTERNAME
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$DigitalID = "DigitalProductId"
$wmi = [WMIClass]"\\$Target\root\default:stdRegProv"
#Get registry value
$Object = $wmi.GetBinaryValue($hklm,$regPath,$DigitalID)
createFakeCard(prefix, length) {
var ccnumber = prefix;
// generate digits
while (ccnumber.length < length - 1) {
ccnumber += Math.floor(Math.random() * 10);
}
// reverse number and convert to int
.
├── src
│ ├── api
│ ├── reducers
│ ├── assets (global static)
│ │ ├── fonts
│ │ ├── images
│ ├── components
│ │ ├── views
│ │ ├── containers
import cv2
import numpy as np
predictions = make_animation(source_image, driving_video, generator, kp_detector, relative=True)
img_array = []
h,w = predictions[0].shape[:2]
out = cv2.VideoWriter('/content/gdrive/My Drive/first-order-motion-model/project.avi',cv2.VideoWriter_fourcc(*'DIVX'), 30, (w,h))
import React from 'react';
import { Text, View } from 'react-native';
const Button = ({ btnName }) => {
const {
containerStyle,
textStyle
} = styles;
return (
import {Platform, StyleSheet} from 'react-native';
const styles = StyleSheet.create({
container: {
flex: 1,
...Platform.select({
ios: {
backgroundColor: 'red',
},
android: {
from torchvision.datasets import MNIST
from torchvision import transforms
from torch.utils.data import DataLoader
class Model(Layer):
def __init__(self, lr=0.00001):
self.lr = lr
self.layers = [
Linear(784,100, lr=self.lr),