Skip to content

Instantly share code, notes, and snippets.

View bravo325806's full-sized avatar

WeiCheng bravo325806

  • NUTC_I.M.A.C
  • taichung
View GitHub Profile
apiVersion: v1
kind: Namespace
metadata:
name: dcgm-exporter
labels:
name: dcgm-exporter
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
def train_model(model, criterion, optimizer, scheduler, num_epochs=25):
since = time.time()
best_model_wts = copy.deepcopy(model.state_dict())
best_acc = 0.0
model.train() # Set model to training mode
for epoch in range(num_epochs):
# print('Epoch {}/{}'.format(epoch, num_epochs - 1))
# print('-' * 10)
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: nginx-mysql
spec:
replicas: 4
selector:
matchLabels:
app: nginx
FROM ubuntu
MAINTAINER cheng <bravo325806@gmail.com>
WORKDIR /var/www/html
RUN apt-get update
RUN apt-get install -y nginx
RUN apt-get install -y php7.0
RUN apt-get install -y php7.0-mysql
RUN apt-get install -y git
import librosa
import os
import re
import sys
import wave
import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
from random import shuffle
from tensorflow.python.tools import freeze_graph
import tensorflow as tf
import numpy as np
import os
import time
import cv2
from random import shuffle
class mnist(object):
learning_rate = 0.001
input_node_name = 'input'
import math
class MLP():
learning_rate = 0.1
epoch = 2000
display = 100
w11=0.5;w12=0.9;w21=0.4;w22=1.0;w31=-1.2;w32=1.1;b1=-1;b2=-1;b3=-1
def train(self):
step = 1
def get_articles_content(this_page_article_href):
for url in this_page_article_href:
print('------------------------------------')
print("https://www.ptt.cc" + url )
r = requests.get("https://www.ptt.cc" + url )
soup = BeautifulSoup(r.text,"html.parser")
# try:
# author = soup.select('span.article-meta-value')[0].text
# board = soup.select('span.article-meta-value')[1].text
# title = soup.select('span.article-meta-value')[2].text