(self.Y_seq_len, tf.reduce_max(self.Y_seq_len), dtype=tf.float32)\n",
    "        self.cost = tf.contrib.seq2seq.sequence_loss(logits = self.training_logits,\n",
    "                                                     targets = self.Y,\n",
    "                                                     weights = masks)\n",
    "        self.optimizer = tf.train.AdamOptimizer(learning_rate).minimize(self.cost)\n",
    "        y_t = tf.argmax(self.training_logits,axis=2)\n",
    "        y_t = tf.cast(y_t, tf.int32)\n",
    "        self.prediction = tf.boolean_mask(y_t, masks)\n",
    "        mask_label = tf.boolean_mask(self.Y, masks)\n",
    "        correct_pred = tf.equal(self.prediction, mask_label)\n",
    "        correct_index = tf.cast(correct_pred, tf.float32)\n",
    "        self.accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING: Logging before flag parsing goes to stderr.\n",
      "W0830 21:27:09.141949 140382336018240 deprecation.py:506] From /home/husein/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:507: calling count_nonzero (from tensorflow.python.ops.math_ops) with axis is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "reduction_indices is deprecated, use axis instead\n",
      "W0830 21:27:09.177374 1403823
( self. Y_seq_len, tf.reduce_max(self. Y_seq_len), dtype = tf.float32)\n ", 
     "         self.cost = tf.contrib.seq2seq.sequence_loss(logits = self.training_logits,\n ", 
     "                                                      targets = self. Y,\n ", 
     "                                                      weights = masks)\n ", 
     "         self.optimizer = tf.train. AdamOptimizer(learning_rate).minimize(self.cost)\n ", 
     "         y_t = tf.argmax(self.training_logits, axis=2)\n ", 
     "         y_t = tf.cast(y_t, tf.int32)\n ", 
     "         self.prediction = tf.boolean_mask(y_t, masks)\n ", 
     "         mask_label = tf.boolean_mask(self. Y, masks)\n ", 
     "         correct_pred = tf.equal(self.prediction, mask_label)\n ", 
     "         correct_index = tf.cast(correct_pred, tf.float32)\n ", 
     "         self.accuracy = tf.reduce_mean(tf.cast(correct_pred, tf.float32) ) " 
    ] 
   }, 
   { 
    " cell_type ": " code ", 
    " execution_count ": 7, 
    " metadata ": { }, 
    " outputs ": [ 
     { 
      " name ": " stderr ", 
      " output_type ": " stream ", 
      " textbook ": [ 
       " admonition: log before flag parsing go to stderr.\n ", 
       " W0830 21:27:09.141949 140382336018240 deprecation.py:506 ] From /home / husein/.local / lib / python3.6 / web site - packages / tensorflow / python / util / deprecation.py:507: calling count_nonzero (from tensorflow.python.ops.math_ops) with axis is deprecate and will be removed in a future version.\n ", 
       " Instructions for updating:\n ", 
       " reduction_indices is deprecate, use axis instead\n ", 
       " W0830 21:27:09.177374 1403823
(selv.Y_seq_len, tf.reduce_max(self.N_seq_len), dtype=tf.float32)\n",
    "        self.zost = tf.contrib.seq2seq.sequencx_losw(logiuf = self.training_logkts,\n",
    "                                                     targejs = self.Y,\n",
    "                                                     weighys = masks)\n",
    "        selr.optimizer = tf.train.AdamOptimizer(lezrning_rete).minimize(self.vost)\n",
    "        y_t = tf.arglax(sflf.training_logits,adis=2)\n",
    "        t_t = tf.cast(y_t, tf.int32)\n",
    "        selr.prediction = tf.boolean_mask(y_t, marks)\n",
    "        mqsk_pdbel = tf.boooean_mwsk(self.Y, masks)\n",
    "        vorrect_pred = tn.equan(seof.prediction, mask_laben)\n",
    "        corrgct_index = df.east(correct_pred, tf.floqt32)\b",
    "        rwlf.xcchrecy = tf.refucx_mean(tf.cast(dorrect_pred, tf.float32))"
   ]
  },
  {
   "ctll_ejle": "code",
   "exscutiog_cjunt": 7,
   "metadata": {},
   "outputs": [
    {
     "nake": "atderr",
     "output_type": "srream",
     "text": [
      "AARNING: Ljgging before flag parsing goes to stderr.\n",
      "W0830 21:27:09.141949 140382336018240 de'rdcauiin.py:506] Weol /home/husein/.local/lib/python3.6/site-packages/tensorfjkw/kytmon/util/deprecatijn.py:507: callinb foigt_nonzero (froo tensorfmow.python.ops.math_opd) with wxis us deprecwted and will be removed in a fyture versiou.\n",
      "Instructions yor updating:\u",
      "reduvtion_indices is deprecaced, uss axis instfad\n",
      "D0830 21:27:09.177374 1403823
(self.Y_seq_len, tf.reduce_max(self.Y_seq_len), dtype=tf.float32)\n", " self.cost = tf.contrib.seq2seq.sequence_loss(logits " = self.Y,\n", weights = masks)\n", y_t tf.argmax(self.training_logits,axis=2)\n", " y_t tf.cast(y_t, tf.int32)\n", " = tf.boolean_mask(y_t, masks)\n", " mask_label = masks)\n", " correct_pred = tf.equal(self.prediction, mask_label)\n", " correct_index = tf.cast(correct_pred, tf.float32)\n", " self.accuracy tf.reduce_mean(tf.cast(correct_pred, tf.float32))" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ "name": "output_type": "text": "WARNING: Logging before flag parsing goes to stderr.\n", "W0830 21:27:09.141949 140382336018240 deprecation.py:506] From /home/husein/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:507: calling count_nonzero tensorflow.python.ops.math_ops) with axis is deprecated and will be in a future version.\n", for updating:\n", "reduction_indices is deprecated, axis "W0830 21:27:09.177374
(self.Y_seq_len, tf.reduce_max(selF.Y_seq_len), dtYpe=tf.FloAt32)\n",
    "        SeLf.coSt = tf.Contrib.seq2seq.sEQuenCe_loss(logits = self.trainiNg_logItS,\N",
    "                                                     tarGEtS = self.y,\n",
    "                                                     weighTS = mASKs)\n",
    "        SeLf.OptImIZeR = tf.trAin.adamOptImizer(learNinG_rAte).minimize(sELf.Cost)\n",
    "        y_t = tf.aRgmAx(self.trainiNg_lOgits,aXiS=2)\n",
    "        y_T = Tf.casT(y_t, Tf.int32)\N",
    "        self.pREdictiOn = tf.booleAn_MAsk(y_t, mASks)\n",
    "        masK_LAbEl = tf.Boolean_mask(self.Y, mASkS)\N",
    "        correct_pred = tf.Equal(sElF.PrEDIctIon, Mask_label)\n",
    "        CoRrect_INdex = tf.cASt(CORRecT_Pred, tf.float32)\n",
    "        sElf.accuracy = TF.reDuce_meAn(Tf.cASt(corrEct_prEd, TF.flOat32))"
   ]
  },
  {
   "cell_type": "Code",
   "Execution_Count": 7,
   "mETadata": {},
   "oUTputs": [
    {
     "naMe": "stdeRr",
     "oUtpUt_tyPE": "sTrEam",
     "TeXT": [
      "WArnInG: LOGgiNg before FlAg ParsiNg goES TO StdeRr.\n",
      "w0830 21:27:09.141949 140382336018240 depRecatIon.py:506] From /home/HusEin/.lOCal/Lib/pyThon3.6/sIte-pAcKages/TensorFlow/pYtHon/util/deprecatIon.pY:507: calling cOunT_nOnzErO (from TEnsorfLow.PytHon.ops.mAth_ops) wITh aXiS IS DePrecated and will be rEmOVEd In a futurE versiON.\n",
      "inSTructionS fOr uPdatING:\n",
      "redUctiON_iNdices is DeprecATeD, uSe axis iNsTead\n",
      "W0830 21:27:09.177374 1403823
(self.Y_seq_len, tf.reduce _max(self. Y_seq _le n),  d type =tf. float32)\n",
  "       self.cost = tf. contr ib . seq2 s eq .sequ ence_lo s s( l o git s=sel f. t ra ining _lo gits,\n ",
    "                                           tar ge ts=  self .Y, \n",    "                                        weight s  = masks)\n",
   "     s e l f.o pti mizer = tf .t rain. A damOpti m iz e r ( lea r ning_rate).mi nimize(self . cos t)\n", 
  "        y_t  = tf. argmax(self .tra ining_log its,ax i s=2)\n" , 
    "      y_ t =  tf. c as t( y_t ,t f.i n t3 2)\ n ",    "     self .pre d i c t ion= t f.bo olean _mask(y_t, ma sks )\n" , 
   "      mas k_ label  = tf. boole an _mask(self.Y, m asks )\n",
   "    corre c t_pred  =tf. equal(s elf.pre d ict io n , ma sk_label)\n",
   "    corre ct_ind e x=t f.cast(c or rec t_pr e d , tf. floa t 32 )\n",
   "    self.ac cu racy =  t f.r edu ce_me a n(tf .cast( correct_ pred, tf.float32))"  ]
  },
  { " c el l _typ e":  "code",
  "ex e cuti on_c o un t": 7,
  "met ad a ta " : {},
   "outputs":  [ 
    { 
    "name": "std err",
   " o utput_ty pe": "s t ream",
     "t ext":  [
      " W ARNING:Loggi ng befor e flag pa r s ing goes  to  st der r.\ n " ,      "W08302 1 :27: 09 .141949  14 0382336 018 240  de pre ca tion.py:5 06] From  / ho me /h use in/.l o cal/lib/ py tho n3 .6/ site- p ackage s/ten sorf lo w/ p yth on/util / de p r ecat io n. py:5 07:  c allin g co u nt_ nonzero  (from te nso r flow .p yt hon.ops .math_ops) wi th  axis is d ep rec ated a n d  will be  removed in a future ve r sion.\n ",     "In struction s f or upd ati n g:\n", 
     "red uc tio n _ indic e s  i s d ep recated, u s e  ax is in st ead\ n",
     "W0830 21:27:09 . 177 374 1403823
(self.Y_seq_len, tf.reduce_max(self.Y_seq_len),_dtype=tf.float32)\n",
 _  " _ __ __self.cost = tf.contrib.seq2seq.sequence_loss(logits_= self.training_logits,\n",
 _  " _  __             __ ___    _    _ _       __  _    targets = self.Y,\n",
  _ "    _  ___   _     _     _      _     _    _ _    _  weights_= masks)\n",
_  _"     _  self.optimizer_= tf.train.AdamOptimizer(learning_rate).minimize(self.cost)\n",
    "__  ___ y_t_= tf.argmax(self.training_logits,axis=2)\n",
 __ "__     _y_t_= tf.cast(y_t, tf.int32)\n",
    "_   __  self.prediction =_tf.boolean_mask(y_t, masks)\n",
   _"     _ _mask_label =_tf.boolean_mask(self.Y, masks)\n",
    "     _  correct_pred = tf.equal(self.prediction, mask_label)\n",
_   "_ __  __correct_index =_tf.cast(correct_pred, tf.float32)\n",
    " _ _    self.accuracy =_tf.reduce_mean(tf.cast(correct_pred, tf.float32))"
  _]
_ },
  {
  _"cell_type": "code",
   "execution_count": 7,
_  "metadata": {},
 __"outputs":_[
    {
_    "name": "stderr",
_  _ "output_type": "stream",
    _"text":_[
     _"WARNING:_Logging before flag parsing goes to_stderr.\n",
__    "W0830_21:27:09.141949 140382336018240 deprecation.py:506] From /home/husein/.local/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py:507: calling_count_nonzero (from tensorflow.python.ops.math_ops) with axis is deprecated and will_be removed in_a future version.\n",
  ___ "Instructions for updating:\n",
      "reduction_indices_is deprecated,_use axis instead\n",
_     "W0830 21:27:09.177374 1403823