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
<main></main> |
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
<div id="q-app"> | |
<div class="q-ma-md"> | |
Fork and make your own! | |
Do NOT use self-closing tags here on Codepen. | |
</div> | |
<div class="q-ma-md"> | |
<q-btn label="Notify" color="primary" @click="notify"></q-btn> | |
</div> |
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 nvidia/cuda:9.2-cudnn7-devel-ubuntu16.04 | |
ARG PYTHON_VERSION=3.6 | |
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 | |
ENV PATH /opt/conda/bin:$PATH | |
# Install basic packages for Ubuntu | |
RUN apt-get update --fix-missing && apt-get install -y wget bzip2 ca-certificates \ | |
libglib2.0-0 libxext6 libsm6 libxrender1 \ | |
git mercurial subversion && \ |
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 sys | |
from PyQt5.QtWidgets import QApplication, QWidget,QLabel, QMessageBox, QPushButton | |
from PyQt5.QtGui import QIcon, QPixmap | |
from PyQt5.QtCore import pyqtSlot, QTimer, QDateTime, QDate, QTime | |
from Ui_Pomodoro import Ui_Dialog | |
from PyQt5 import QtCore | |
import time | |
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 get_expire_date(fid): | |
tree = ET.fromstring(info_s) | |
for root in tree.iter(): | |
for child_of_root in root: | |
if child_of_root.tag == 'feature': | |
print(child_of_root.attrib['id']) |
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
''' 给定一个字符串, | |
要求把字符串前面的若干个字符移动到字符串的尾部,如把字符串“abcdef”前面的2个字符'a'和'b'移动到字符串的尾部, | |
使得原字符串变成字符串“cdefab”。 | |
请写一个函数完成此功能, | |
要求对长度为n的字符串操作的时间复杂度为 O(n),空间复杂度为 O(1)。 ''' | |
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
@when('I start to train') | |
def start_train(tmpdir, mocker, context, qtbot, monkeypatch): | |
model_folder = os.path.join(tmpdir, 'model_folder') | |
mocker.patch.object(window.main_view.dialog_train, 'model_folder', return_value=(model_folder, None)) | |
# click the train | |
window.main_view._ui.actionTrain.trigger() | |
# begin to train |
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
!pip3 install --quiet "tensorflow>=1.7" | |
!pip3 install --quiet tensorflow-hub | |
!pip3 install seaborn | |
import tensorflow as tf | |
import tensorflow_hub as hub | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import os | |
import pandas as pd |
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
!wget https://raw.githubusercontent.com/Tony607/Keras-Text-Transfer-Learning/master/train_5500.txt | |
!wget https://raw.githubusercontent.com/Tony607/Keras-Text-Transfer-Learning/master/test_data.txt | |
def get_dataframe(filename): | |
lines = open(filename, 'r').read().splitlines() | |
data = [] | |
for i in range(0, len(lines)): | |
label = lines[i].split(' ')[0] |
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
module_url = "https://tfhub.dev/google/universal-sentence-encoder-large/3" | |
embed = hub.Module(module_url) | |
embed_size = embed.get_output_info_dict()['default'].get_shape()[1].value |
OlderNewer