start new:
tmux
start new with session name:
tmux new -s myname
[emacs] | |
name=Emacs 24.2 repo | |
baseurl=http://pj.freefaculty.org/EL/6/x86_64/ | |
failovermethod=priority | |
enabled=1 | |
gpgcheck=1 | |
gpgkey=http://pj.freefaculty.org/EL/PaulJohnson-BinaryPackageSigningKey |
class AttentionLSTM(LSTM): | |
"""LSTM with attention mechanism | |
This is an LSTM incorporating an attention mechanism into its hidden states. | |
Currently, the context vector calculated from the attended vector is fed | |
into the model's internal states, closely following the model by Xu et al. | |
(2016, Sec. 3.1.2), using a soft attention model following | |
Bahdanau et al. (2014). | |
The layer expects two inputs instead of the usual one: |
import org.apache.spark.Partitioner | |
class TwoPartsPartitioner(override val numPartitions: Int) extends Partitioner { | |
def getPartition(key: Any): Int = key match { | |
case s: String => { | |
if (s(0).toUpper > 'J') 1 else 0 | |
} | |
} | |
} |