Тестирование программного обеспечения в наши дни стало неотъемлемой частью процесса разработки программного обеспечения во всем мире. Уже не найти ни одного серьезного проекта без покрытия, хотя-бы Unit-тестами. Существуют различные техники и подходы к тестированию. Кто-то покрывает тестами уже написанный код, кто-то использует тестирование как инструмент для добавления новой функциональности (разработка через тестирование). В обоих случаях время, затраченное на тестирование кода, включается в общие затраты по разработке. И чем больше и сложнее проект, тем большее время тратится для выполнения всех тестов. Как оптимизировать затраты на тестирование? Существует несколько путей оптимизации процесса тестирования продукта. От рефакторинга тестов и тестовых данных, до увеличения мощностей оборудования. Рефакторинг и оптимизированный запуск разных групп тестовых заданий действительно может сократить время общего прогона тестов, но в конечном итоге встает вопрос вертикального масштабирования, если ресурсов не хватае
# reduce learning rate after 120 epochs (60000 iters) by factor 0f 10 | |
# then another factor of 10 after 10 more epochs (5000 iters) | |
# The train/test net protocol buffer definition | |
net: "examples/cifar10/cifar10_full_train_test_prelu.prototxt" | |
# test_iter specifies how many forward passes the test should carry out. | |
# In the case of CIFAR10, we have test batch size 100 and 100 test iterations, | |
# covering the full 10,000 testing images. | |
test_iter: 100 | |
# Carry out testing every 1000 training iterations. |
#!/usr/bin/env python | |
# see http://matpalm.com/blog/2015/03/28/theano_word_embeddings/ | |
import theano | |
import theano.tensor as T | |
import numpy as np | |
import random | |
E = np.asarray(np.random.randn(6, 2), dtype='float32') | |
t_E = theano.shared(E) | |
t_idxs = T.ivector() |
import logging | |
from sqlalchemy import inspect | |
from sqlalchemy.ext.declarative.clsregistry import _ModuleMarker | |
from sqlalchemy.orm import RelationshipProperty | |
logger = logging.getLogger(__name__) | |
def is_sane_database(Base, session): |
#!/bin/sh | |
# Which md files to compile | |
declare -a arr=("hybrid-recommender" "text-matching" "pre-populated-recommenders") | |
# Now loop through the above array | |
for i in "${arr[@]}" | |
do | |
# Where to store the documentation |
All types torch.DoubleTensor
, torch.FloatTensor
, etc. should have their
sparse variants: torch.SparseDoubleTensor
, torch.SparseFloatTensor
, etc.
Copying between dense and sparse matrix should be done with :copy() function.
Underlying BLAS has to be swappable with MKL/OpenBLAS/Atlas, etc. Other math operations have to implemented with CSPARSE.
##Model
This is an implementation of Facebook's baseline GRU/LSTM model on the bAbI dataset Weston et al. 2015. It includes an interactive demo.
The bAbI dataset contains 20 different question answering tasks.
The model training script train.py and demo script demo.py are included below.
Your Flask app object implements the __call__
method, which means it can be called like a regular function.
When your WSGI container receives a HTTP request it calls your app with the environ
dict and the start_response
callable.
WSGI is specified in PEP 0333.
The two relevant environ variables are:
SCRIPT_NAME
The initial portion of the request URL's "path" that corresponds to the application object, so that the application knows its virtual "location". This may be an empty string, if the application corresponds to the "root" of the server.
import types | |
import tensorflow as tf | |
import numpy as np | |
# Expressions are represented as lists of lists, | |
# in lisp style -- the symbol name is the head (first element) | |
# of the list, and the arguments follow. | |
# add an expression to an expression list, recursively if necessary. | |
def add_expr_to_list(exprlist, expr): |