btgym.research.casual_conv.layers module

btgym.research.casual_conv.networks module

btgym.research.casual_conv.networks.conv_1d_casual_encoder(x, ob_space, ac_space, conv_1d_num_filters=32, conv_1d_filter_size=2, conv_1d_activation=<function elu>, conv_1d_overlap=1, name='casual_encoder', keep_prob=None, conv_1d_gated=False, reuse=False, collections=None, **kwargs)[source]

Tree-shaped convolution stack encoder as more comp. efficient alternative to dilated one.

Stage1 casual convolutions network: from 1D input to estimated features.

Returns:tensor holding state features;
btgym.research.casual_conv.networks.attention_layer(inputs, attention_ref=<class 'tensorflow.contrib.seq2seq.python.ops.attention_wrapper.LuongAttention'>, name='attention_layer', **kwargs)[source]

Temporal attention layer. Computes attention context based on last(left) value in time dim.

Paper: Minh-Thang Luong, Hieu Pham, Christopher D. Manning., “Effective Approaches to Attention-based Neural Machine Translation.” https://arxiv.org/abs/1508.04025

Parameters:
  • inputs
  • attention_ref – attention mechanism class
  • name
Returns:

attention output tensor

btgym.research.casual_conv.networks.conv_1d_casual_attention_encoder(x, ob_space, ac_space, conv_1d_num_filters=32, conv_1d_filter_size=2, conv_1d_activation=<function elu>, conv_1d_attention_ref=<class 'tensorflow.contrib.seq2seq.python.ops.attention_wrapper.LuongAttention'>, name='casual_encoder', keep_prob=None, conv_1d_gated=False, conv_1d_full_hidden=False, reuse=False, collections=None, **kwargs)[source]

Tree-shaped convolution stack encoder with self-attention.

Stage1 casual convolutions network: from 1D input to estimated features.

Returns:tensor holding state features;

btgym.research.casual_conv.policy module

class btgym.research.casual_conv.policy.CasualConvPolicy_0_0(state_encoder_class_ref=<function conv_1d_casual_encoder>, conv_1d_num_filters=32, conv_1d_filter_size=2, conv_1d_slice_size=1, conv_1d_activation=<function elu>, conv_1d_use_bias=False, **kwargs)[source]

Casual.0.

btgym.research.casual_conv.strategy module

class btgym.research.casual_conv.strategy.CasualConvStrategy(**kwargs)[source]

Provides stream of data for casual convolutional encoder

class btgym.research.casual_conv.strategy.MaxPool[source]

Custom period sliding candle upper bound.

class btgym.research.casual_conv.strategy.MinPool[source]

Custom period sliding candle lower bound.

class btgym.research.casual_conv.strategy.CasualConvStrategy_0(**kwargs)[source]

Casual convolutional encoder + sliding candle price data features instead of SMA.

class btgym.research.casual_conv.strategy.CasualConvStrategy_1(**kwargs)[source]

CWT. again.

class btgym.research.casual_conv.strategy.CasualConvStrategyMulti(**kwargs)[source]

CWT + multiply data streams. Beta - data names are class hard-coded. TODO: pass data streams names as params

nextstart()[source]

Overrides base method augmenting it with estimating expert actions before actual episode starts.