Skip to content

Commit

Permalink
Remove "No handlers could be found for logger "gensim.models.word2vec".
Browse files Browse the repository at this point in the history
  • Loading branch information
markroxor authored and mon95 committed Nov 11, 2016
1 parent 6f35d50 commit 57bb655
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gensim/models/word2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
from types import GeneratorType

logger = logging.getLogger(__name__)
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s')


try:
Expand Down Expand Up @@ -278,6 +279,14 @@ def train_sg_pair(model, word, context_index, alpha, learn_vectors=True, learn_h
return neu1e


def sigmoid(p):
if p > 0:
return 1. / (1. + exp(-p))
elif p <= 0:
return exp(p) / (1 + exp(p))
else:
raise ValueError

def train_cbow_pair(model, word, input_word_indices, l1, alpha, learn_vectors=True, learn_hidden=True):
neu1e = zeros(l1.shape)

Expand Down

0 comments on commit 57bb655

Please sign in to comment.