# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
pycurl: libcurl link-time ssl backend (nss) is different from compile-time ssl backend (openssl)
Please install a package which provides this module, or
verify that the module is installed correctly.
- Download CMake from: https://cmake.org/download/
wget https://cmake.org/files/v3.11/cmake-3.11.0.tar.gz
- Compile from source and install
tar zxvf cmake-3.11.0.tar.gz && cd cmake-3.11.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
# (C) Kyle Kastner, June 2014 | |
# License: BSD 3 clause | |
import scipy.stats as st | |
import numpy as np | |
class gmmhmm: | |
#This class converted with modifications from https://code.google.com/p/hmm-speech-recognition/source/browse/Word.m | |
def __init__(self, n_states): | |
self.n_states = n_states |
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
# You may use this CentOS 7 repository on Fedora Copr for Vim 8 builds. | |
# https://copr.fedorainfracloud.org/coprs/mcepl/vim8/ | |
# | |
# Run these commands on CentOS 7. | |
# Add this repository: | |
sudo curl -L https://copr.fedorainfracloud.org/coprs/mcepl/vim8/repo/epel-7/mcepl-vim8-epel-7.repo -o /etc/yum.repos.d/mcepl-vim8-epel-7.repo | |
# Upgrade Vim to vim 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
# coding:utf-8 | |
from elasticsearch import Elasticsearch | |
import json | |
# Define config | |
host = "127.0.0.1" | |
port = 9200 | |
timeout = 1000 | |
index = "index" |
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
#!/usr/bin/env python | |
# -*- coding:UTF-8 -*- | |
import torch | |
import torch.nn as nn | |
import torch.nn.init as init | |
def weight_init(m): | |
''' |
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 | |
from torch import LongTensor | |
from torch.nn import Embedding, LSTM | |
from torch.autograd import Variable | |
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence | |
## We want to run LSTM on a batch of 3 character sequences ['long_str', 'tiny', 'medium'] | |
# | |
# Step 1: Construct Vocabulary | |
# Step 2: Load indexed data (list of instances, where each instance is list of character indices) |
(1)其分析的資料為何?(2) 其應用為何? (3) 要達成該應用有什麼問題需要解決?
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 tensorflow as tf | |
def create_bad_dataset(create_batches=True): | |
dataset = tf.data.Dataset.from_tensor_slices([1., 2., 0., 4., 8., 16.]) | |
# Computing `tf.check_numerics(1. / 0.)` will raise an InvalidArgumentError. | |
if create_batches: | |
# Demonstrates that error handling works with map_and_batch | |
dataset = dataset.apply(tf.contrib.data.map_and_batch( | |
map_func=lambda x: tf.check_numerics(1. / x, 'error'), batch_size=2)) |
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 numpy as np | |
import tensorflow as flow | |
from tensorflow.python.saved_model import loader | |
# first, read the pretrained weights into a dictionary | |
variables = {} | |
g1 = tf.Graph() | |
with g1.as_default(): | |
restore_from = 'pretrained_model/1513006564' | |
with tf.Session() as sess: |
OlderNewer