├── fynance ├── tests │ ├── __init__.py │ ├── core │ │ ├── __init__.py │ │ └── series.py │ ├── backtest │ │ └── __init__.py │ ├── neural_networks │ │ └── __init__.py │ ├── features │ │ └── __init__.py │ └── models │ │ ├── __init__.py │ │ └── test_econometric_models.py ├── estimator │ └── __init__.py ├── core │ └── __init__.py ├── neural_networks │ ├── README.md │ └── __init__.py ├── algorithms │ ├── __init__.py │ ├── browsers.py │ └── rolling.py ├── backtest │ ├── __init__.py │ └── _basis_plot.py ├── models │ ├── __init__.py │ ├── basis.py │ ├── xgb.py │ └── attention.py ├── _exceptions.py ├── features │ ├── __init__.py │ ├── filters.py │ └── money_management.py └── __init__.py ├── .gitattributes ├── pictures ├── rolling_mechanism.png ├── loss_RollNeuralNet.png └── backtest_RollNeuralNet.png ├── tox.ini ├── doc └── source │ ├── _static │ └── rolling_mechanism.png │ ├── _templates │ ├── autosummary │ │ ├── method.rst │ │ ├── attribute.rst │ │ ├── property.rst │ │ ├── member.rst │ │ └── class.rst │ ├── indexsidebar.html │ ├── layout.html │ └── searchbox.html │ ├── generated │ ├── fynance.features.metrics.mad.rst │ ├── fynance.features.metrics.mdd.rst │ ├── fynance.features.momentums.ema.rst │ ├── fynance.features.momentums.sma.rst │ ├── fynance.features.momentums.wma.rst │ ├── fynance.features.indicators.cci.rst │ ├── fynance.features.indicators.hma.rst │ ├── fynance.features.indicators.rsi.rst │ ├── fynance.features.metrics.calmar.rst │ ├── fynance.features.metrics.sharpe.rst │ ├── fynance.features.metrics.z_score.rst │ ├── fynance.features.momentums.emstd.rst │ ├── fynance.features.momentums.smstd.rst │ ├── fynance.features.momentums.wmstd.rst │ ├── fynance.features.scale.normalize.rst │ ├── fynance.algorithms.allocation.ERC.rst │ ├── fynance.algorithms.allocation.HRP.rst │ ├── fynance.algorithms.allocation.IVP.rst │ ├── fynance.algorithms.allocation.MDP.rst │ ├── fynance.algorithms.allocation.MVP.rst │ ├── fynance.features.metrics.accuracy.rst │ ├── fynance.features.metrics.drawdown.rst │ ├── fynance.features.metrics.roll_mad.rst │ ├── fynance.features.metrics.roll_mdd.rst │ ├── fynance.features.scale.standardize.rst │ ├── fynance.features.scale.Scale.fit.rst │ ├── fynance.algorithms.allocation.MVP_uc.rst │ ├── fynance.features.metrics.perf_index.rst │ ├── fynance.features.metrics.perf_strat.rst │ ├── fynance.features.metrics.roll_calmar.rst │ ├── fynance.features.metrics.roll_sharpe.rst │ ├── fynance.features.scale.Scale.scale.rst │ ├── fynance.models.econometric_models.MA.rst │ ├── fynance.features.indicators.macd_hist.rst │ ├── fynance.features.indicators.macd_line.rst │ ├── fynance.features.metrics.perf_returns.rst │ ├── fynance.features.scale.Scale.revert.rst │ ├── fynance.features.scale.roll_normalize.rst │ ├── fynance.features.metrics.annual_return.rst │ ├── fynance.features.metrics.roll_drawdown.rst │ ├── fynance.features.metrics.roll_z_score.rst │ ├── fynance.models.econometric_models.ARMA.rst │ ├── fynance.features.indicators.signal_line.rst │ ├── fynance.features.scale.Scale.__call__.rst │ ├── fynance.features.scale.roll_standardize.rst │ ├── fynance.features.roll_functions.roll_max.rst │ ├── fynance.features.roll_functions.roll_min.rst │ ├── fynance.features.indicators.bollinger_band.rst │ ├── fynance.features.metrics.annual_volatility.rst │ ├── fynance.features.metrics.diversified_ratio.rst │ ├── fynance.models.rolling._RollingBasis.run.rst │ ├── fynance.features.metrics.roll_annual_return.rst │ ├── fynance.neural_networks.RollNeuralNet.run.rst │ ├── fynance.models.econometric_models.ARMA_GARCH.rst │ ├── fynance.models.econometric_models.ARMAX_GARCH.rst │ ├── fynance.models.rolling._RollingBasis.pre_run.rst │ ├── fynance.models.rolling._RollingBasis.__call__.rst │ ├── fynance.algorithms.allocation.rolling_allocation.rst │ ├── fynance.features.metrics.roll_annual_volatility.rst │ ├── fynance.models.econometric_models.get_parameters.rst │ ├── fynance.models.neural_network.BaseNeuralNet.to.rst │ ├── fynance.neural_networks.RollMultiNeuralNet.run.rst │ ├── fynance.neural_networks.RollNeuralNet.__call__.rst │ ├── fynance.models.neural_network.BaseNeuralNet.cpu.rst │ ├── fynance.neural_networks.RollNeuralNet.plot_loss.rst │ ├── fynance.neural_networks.RollNeuralNet.plot_perf.rst │ ├── fynance.models.neural_network.BaseNeuralNet.apply.rst │ ├── fynance.models.neural_network.BaseNeuralNet.cuda.rst │ ├── fynance.models.neural_network.BaseNeuralNet.eval.rst │ ├── fynance.models.neural_network.BaseNeuralNet.float.rst │ ├── fynance.models.neural_network.BaseNeuralNet.half.rst │ ├── fynance.models.neural_network.BaseNeuralNet.train.rst │ ├── fynance.models.neural_network.BaseNeuralNet.type.rst │ ├── fynance.models.neural_network.BaseNeuralNet.double.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.to.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.run.rst │ ├── fynance.neural_networks.RollMultiRollNeuralNet.run.rst │ ├── fynance.models.neural_network.BaseNeuralNet.buffers.rst │ ├── fynance.models.neural_network.BaseNeuralNet.forward.rst │ ├── fynance.models.neural_network.BaseNeuralNet.modules.rst │ ├── fynance.models.neural_network.BaseNeuralNet.predict.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.cpu.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.run.rst │ ├── fynance.neural_networks.RollMultiNeuralNet.__call__.rst │ ├── fynance.models.neural_network.BaseNeuralNet.__call__.rst │ ├── fynance.models.neural_network.BaseNeuralNet.children.rst │ ├── fynance.models.neural_network.BaseNeuralNet.set_data.rst │ ├── fynance.models.neural_network.BaseNeuralNet.set_seed.rst │ ├── fynance.models.neural_network.BaseNeuralNet.train_on.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.cuda.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.eval.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.half.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.save.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.type.rst │ ├── fynance.neural_networks.RollMultiNeuralNet.plot_loss.rst │ ├── fynance.neural_networks.RollMultiNeuralNet.plot_perf.rst │ ├── fynance.models.neural_network.BaseNeuralNet.add_module.rst │ ├── fynance.models.neural_network.BaseNeuralNet.extra_repr.rst │ ├── fynance.models.neural_network.BaseNeuralNet.load_model.rst │ ├── fynance.models.neural_network.BaseNeuralNet.parameters.rst │ ├── fynance.models.neural_network.BaseNeuralNet.save_model.rst │ ├── fynance.models.neural_network.BaseNeuralNet.state_dict.rst │ ├── fynance.models.neural_network.BaseNeuralNet.zero_grad.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.cpu.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.to.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.apply.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.double.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.float.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.train.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.cuda.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.eval.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.half.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.type.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.buffers.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.forward.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.modules.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.pre_run.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.predict.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.__call__.rst │ ├── fynance.neural_networks.RollMultiRollNeuralNet.__call__.rst │ ├── fynance.models.neural_network.BaseNeuralNet.share_memory.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.apply.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.float.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.train.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.__call__.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.children.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.set_data.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.set_seed.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.train_on.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.aggregate.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.plot_loss.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.plot_perf.rst │ ├── fynance.neural_networks.RollMultiRollNeuralNet.plot_loss.rst │ ├── fynance.neural_networks.RollMultiRollNeuralNet.plot_perf.rst │ ├── fynance.models.neural_network.BaseNeuralNet.named_buffers.rst │ ├── fynance.models.neural_network.BaseNeuralNet.named_modules.rst │ ├── fynance.models.neural_network.BaseNeuralNet.set_optimizer.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.double.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.zero_grad.rst │ ├── fynance.models.neural_network.BaseNeuralNet.load_state_dict.rst │ ├── fynance.models.neural_network.BaseNeuralNet.named_children.rst │ ├── fynance.models.neural_network.BaseNeuralNet.register_buffer.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.__call__.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.buffers.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.children.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.forward.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.modules.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.predict.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.set_data.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.set_seed.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.train_on.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.add_module.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.extra_repr.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.load_model.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.parameters.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.save_model.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.state_dict.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.sub_predict.rst │ ├── fynance.models.neural_network.BaseNeuralNet.named_parameters.rst │ ├── fynance.models.neural_network.BaseNeuralNet.set_lr_scheduler.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.zero_grad.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.share_memory.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.set_aggregate.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.add_module.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.extra_repr.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.load_model.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.parameters.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.save_model.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.state_dict.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.to.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.named_buffers.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.named_modules.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.set_optimizer.rst │ ├── fynance.models.neural_network.BaseNeuralNet.register_parameter.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.cpu.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.to.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.named_children.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.named_buffers.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.named_modules.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.set_optimizer.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.share_memory.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.apply.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.cuda.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.eval.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.float.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.half.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.train.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.type.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.cpu.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.cuda.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.eval.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.half.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.type.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.load_state_dict.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.named_parameters.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.register_buffer.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.set_lr_scheduler.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.set_roll_period.rst │ ├── fynance.models.neural_network.BaseNeuralNet.register_forward_hook.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.named_children.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.double.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.apply.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.float.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.train.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.to.rst │ ├── fynance.models.neural_network.BaseNeuralNet.register_backward_hook.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.load_state_dict.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.register_buffer.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.buffers.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.forward.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.modules.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.predict.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.double.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cpu.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.register_parameter.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.named_parameters.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.set_lr_scheduler.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.__call__.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.children.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_data.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_seed.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.train_on.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.buffers.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.forward.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.modules.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.predict.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cuda.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.eval.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.half.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.type.rst │ ├── fynance.models.neural_network.BaseNeuralNet.register_forward_pre_hook.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.register_parameter.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.add_module.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.extra_repr.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_model.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.parameters.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.save_model.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.state_dict.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.zero_grad.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.__call__.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.children.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.set_data.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.set_seed.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.train_on.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.zero_grad.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.apply.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.double.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.float.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.register_forward_hook.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.add_module.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.extra_repr.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.load_model.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.parameters.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.save_model.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.state_dict.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.buffers.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.forward.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.modules.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.predict.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.register_backward_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.share_memory.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.__call__.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.children.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_data.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_seed.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train_on.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.register_forward_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_buffers.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_modules.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_optimizer.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.share_memory.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.zero_grad.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.register_backward_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_state_dict.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_children.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_buffer.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.named_buffers.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.named_children.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.named_modules.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.set_optimizer.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.add_module.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.extra_repr.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_model.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.parameters.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.save_model.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.state_dict.rst │ ├── fynance.models.rolling.RollMultiLayerPerceptron.register_forward_pre_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_parameters.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_lr_scheduler.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.load_state_dict.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.register_buffer.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.share_memory.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.register_forward_pre_hook.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.named_parameters.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.set_lr_scheduler.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_buffers.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_modules.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_optimizer.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_parameter.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_children.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.register_parameter.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_state_dict.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_parameters.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_buffer.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_lr_scheduler.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_backward_hook.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_hook.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_parameter.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.register_backward_hook.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_pre_hook.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_hook.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_pre_hook.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_backward_hook.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_pre_hook.rst │ ├── fynance.features.scale.Scale.rst │ ├── fynance.models.rolling._RollingBasis.rst │ ├── fynance.neural_networks.RollNeuralNet.rst │ ├── fynance.neural_networks.RollMultiNeuralNet.rst │ ├── fynance.neural_networks.RollMultiRollNeuralNet.rst │ ├── fynance.neural_networks.RollAggrMultiNeuralNet.rst │ ├── fynance.models.neural_network.BaseNeuralNet.rst │ ├── fynance.models.recurrent_neural_network.GatedRecurrentUnit.rst │ ├── fynance.models.neural_network.MultiLayerPerceptron.rst │ ├── fynance.models.recurrent_neural_network.LongShortTermMemory.rst │ ├── fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.rst │ └── fynance.models.rolling.RollMultiLayerPerceptron.rst │ ├── backtest.rst │ ├── backtest.tools.rst │ ├── models.rst │ ├── algorithms.rst │ ├── neural_networks.rst │ ├── features.roll_functions.rst │ ├── backtest.plot_object.rst │ ├── models.rolling.rst │ ├── models.neural_network.rst │ ├── neural_networks.rolling_neural_networks.rst │ ├── models.econometric_models.rst │ ├── features.indicators.rst │ ├── features.momentums.rst │ ├── features.scale.rst │ ├── algorithms.allocation.rst │ ├── features.rst │ └── features.metrics.rst ├── requirements.txt ├── .gitmodules ├── MANIFEST.in ├── doc-requirements.txt ├── .gitignore ├── .travis.yml ├── .readthedocs.yml └── LICENSE.txt /fynance/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fynance/tests/core/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fynance/tests/backtest/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | Notebooks/* linguist-vendored -------------------------------------------------------------------------------- /fynance/tests/neural_networks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pictures/rolling_mechanism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArthurBernard/Fynance/HEAD/pictures/rolling_mechanism.png -------------------------------------------------------------------------------- /pictures/loss_RollNeuralNet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArthurBernard/Fynance/HEAD/pictures/loss_RollNeuralNet.png -------------------------------------------------------------------------------- /pictures/backtest_RollNeuralNet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArthurBernard/Fynance/HEAD/pictures/backtest_RollNeuralNet.png -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [pytest] 2 | addopts = --doctest-modules --exitfirst -vv --capture=no --ignore="fynance/dev" 3 | testpaths = 4 | fynance -------------------------------------------------------------------------------- /doc/source/_static/rolling_mechanism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArthurBernard/Fynance/HEAD/doc/source/_static/rolling_mechanism.png -------------------------------------------------------------------------------- /doc/source/_templates/autosummary/method.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname }} 4 | {{ underline }} 5 | 6 | .. currentmodule:: {{ module }} 7 | 8 | .. automethod:: {{ objname }} -------------------------------------------------------------------------------- /doc/source/_templates/autosummary/attribute.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname }} 4 | {{ underline }} 5 | 6 | .. currentmodule:: {{ module }} 7 | 8 | .. autoattribute:: {{ objname }} -------------------------------------------------------------------------------- /doc/source/_templates/autosummary/property.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname }} 4 | {{ underline }} 5 | 6 | .. currentmodule:: {{ module }} 7 | 8 | .. autoproperty:: {{ objname }} -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Cython>=0.29.0 2 | matplotlib>=3.0.1 3 | numpy>=1.16.5 4 | numpydoc 5 | pandas>=0.23.4 6 | scipy>=1.2.0 7 | seaborn>=0.9.0 8 | xgboost>=0.81,<1.1 9 | torch>=1.0.0 10 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.mad.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.mad 2 | =============================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: mad -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.mdd.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.mdd 2 | =============================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: mdd -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.ema.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.ema 2 | ================================= 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: ema -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.sma.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.sma 2 | ================================= 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: sma -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.wma.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.wma 2 | ================================= 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: wma -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.cci.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.cci 2 | ================================== 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: cci -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.hma.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.hma 2 | ================================== 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: hma -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.rsi.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.rsi 2 | ================================== 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: rsi -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.calmar.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.calmar 2 | ================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: calmar -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.sharpe.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.sharpe 2 | ================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: sharpe -------------------------------------------------------------------------------- /doc/source/_templates/autosummary/member.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | {{ fullname | escape | underline}} 4 | 5 | .. currentmodule:: {{ module }} 6 | 7 | member 8 | 9 | .. auto{{ objtype }}:: {{ objname }} 10 | 11 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.z_score.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.z\_score 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: z_score -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.emstd.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.emstd 2 | =================================== 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: emstd -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.smstd.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.smstd 2 | =================================== 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: smstd -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.momentums.wmstd.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.momentums\.wmstd 2 | =================================== 3 | 4 | .. currentmodule:: fynance.features.momentums 5 | 6 | .. autofunction:: wmstd -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.normalize.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.scale\.normalize 2 | =================================== 3 | 4 | .. currentmodule:: fynance.features.scale 5 | 6 | .. autofunction:: normalize -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.ERC.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.ERC 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: ERC -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.HRP.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.HRP 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: HRP -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.IVP.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.IVP 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: IVP -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.MDP.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.MDP 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: MDP -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.MVP.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.MVP 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: MVP -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.accuracy.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.accuracy 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: accuracy -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.drawdown.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.drawdown 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: drawdown -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_mad.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_mad 2 | ===================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_mad -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_mdd.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_mdd 2 | ===================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_mdd -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.standardize.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.scale\.standardize 2 | ===================================== 3 | 4 | .. currentmodule:: fynance.features.scale 5 | 6 | .. autofunction:: standardize -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.Scale.fit.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.features.scale.Scale.fit 4 | ================================ 5 | 6 | .. currentmodule:: fynance.features.scale 7 | 8 | .. automethod:: Scale.fit -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.MVP_uc.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.MVP\_uc 2 | ======================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: MVP_uc -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.perf_index.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.perf\_index 2 | ======================================= 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: perf_index -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.perf_strat.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.perf\_strat 2 | ======================================= 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: perf_strat -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_calmar.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_calmar 2 | ======================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_calmar -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_sharpe.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_sharpe 2 | ======================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_sharpe -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.Scale.scale.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.features.scale.Scale.scale 4 | ================================== 5 | 6 | .. currentmodule:: fynance.features.scale 7 | 8 | .. automethod:: Scale.scale -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.econometric_models.MA.rst: -------------------------------------------------------------------------------- 1 | fynance\.models\.econometric\_models\.MA 2 | ======================================== 3 | 4 | .. currentmodule:: fynance.models.econometric_models 5 | 6 | .. autofunction:: MA -------------------------------------------------------------------------------- /fynance/estimator/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | 6 | Some estimators 7 | 8 | """ 9 | 10 | from . import estimator 11 | from .estimator import * 12 | 13 | __all__ = ['estimator'] -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.macd_hist.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.macd\_hist 2 | ========================================= 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: macd_hist -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.macd_line.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.macd\_line 2 | ========================================= 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: macd_line -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.perf_returns.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.perf\_returns 2 | ========================================= 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: perf_returns -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.Scale.revert.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.features.scale.Scale.revert 4 | =================================== 5 | 6 | .. currentmodule:: fynance.features.scale 7 | 8 | .. automethod:: Scale.revert -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.roll_normalize.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.scale\.roll\_normalize 2 | ========================================= 3 | 4 | .. currentmodule:: fynance.features.scale 5 | 6 | .. autofunction:: roll_normalize -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.annual_return.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.annual\_return 2 | ========================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: annual_return -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_drawdown.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_drawdown 2 | ========================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_drawdown -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_z_score.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_z\_score 2 | ========================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_z_score -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.econometric_models.ARMA.rst: -------------------------------------------------------------------------------- 1 | fynance\.models\.econometric\_models\.ARMA 2 | ========================================== 3 | 4 | .. currentmodule:: fynance.models.econometric_models 5 | 6 | .. autofunction:: ARMA -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "doc/scipy-sphinx-theme"] 2 | path = doc/scipy-sphinx-theme 3 | url = https://github.com/scipy/scipy-sphinx-theme.git 4 | [submodule "doc/sphinxext"] 5 | path = doc/sphinxext 6 | url = https://github.com/numpy/numpydoc.git 7 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.signal_line.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.signal\_line 2 | =========================================== 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: signal_line -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.Scale.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.features.scale.Scale.__call__ 4 | ===================================== 5 | 6 | .. currentmodule:: fynance.features.scale 7 | 8 | .. automethod:: Scale.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.roll_standardize.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.scale\.roll\_standardize 2 | =========================================== 3 | 4 | .. currentmodule:: fynance.features.scale 5 | 6 | .. autofunction:: roll_standardize -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE.txt 2 | include README.md 3 | # Top-level build script 4 | include setup.py 5 | # All source files 6 | recursive-include fynance * 7 | # Exclude what we don't want to include 8 | prune */__pycache__ 9 | global-exclude *.pyc *.html -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.roll_functions.roll_max.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.roll\_functions\.roll\_max 2 | ============================================= 3 | 4 | .. currentmodule:: fynance.features.roll_functions 5 | 6 | .. autofunction:: roll_max -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.roll_functions.roll_min.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.roll\_functions\.roll\_min 2 | ============================================= 3 | 4 | .. currentmodule:: fynance.features.roll_functions 5 | 6 | .. autofunction:: roll_min -------------------------------------------------------------------------------- /doc-requirements.txt: -------------------------------------------------------------------------------- 1 | Cython==0.29.0 2 | matplotlib==3.0.1 3 | numpy>=1.15.3 4 | numpydoc 5 | pandas==0.23.4 6 | scipy==1.11.1 7 | seaborn==0.9.0 8 | sphinx<1.7 9 | https://download.pytorch.org/whl/cpu/torch-1.0.1.post2-cp36-cp36m-linux_x86_64.whl 10 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.indicators.bollinger_band.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.indicators\.bollinger\_band 2 | ============================================== 3 | 4 | .. currentmodule:: fynance.features.indicators 5 | 6 | .. autofunction:: bollinger_band -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.annual_volatility.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.annual\_volatility 2 | ============================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: annual_volatility -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.diversified_ratio.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.diversified\_ratio 2 | ============================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: diversified_ratio -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling._RollingBasis.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling._RollingBasis.run 4 | ======================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: _RollingBasis.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_annual_return.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_annual\_return 2 | ================================================ 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_annual_return -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollNeuralNet.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollNeuralNet.run 4 | ========================================= 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollNeuralNet.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.econometric_models.ARMA_GARCH.rst: -------------------------------------------------------------------------------- 1 | fynance\.models\.econometric\_models\.ARMA\_GARCH 2 | ================================================= 3 | 4 | .. currentmodule:: fynance.models.econometric_models 5 | 6 | .. autofunction:: ARMA_GARCH -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.econometric_models.ARMAX_GARCH.rst: -------------------------------------------------------------------------------- 1 | fynance\.models\.econometric\_models\.ARMAX\_GARCH 2 | ================================================== 3 | 4 | .. currentmodule:: fynance.models.econometric_models 5 | 6 | .. autofunction:: ARMAX_GARCH -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling._RollingBasis.pre_run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling._RollingBasis.pre_run 4 | ============================================ 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: _RollingBasis.pre_run -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling._RollingBasis.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling._RollingBasis.__call__ 4 | ============================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: _RollingBasis.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.algorithms.allocation.rolling_allocation.rst: -------------------------------------------------------------------------------- 1 | fynance\.algorithms\.allocation\.rolling\_allocation 2 | ==================================================== 3 | 4 | .. currentmodule:: fynance.algorithms.allocation 5 | 6 | .. autofunction:: rolling_allocation -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.metrics.roll_annual_volatility.rst: -------------------------------------------------------------------------------- 1 | fynance\.features\.metrics\.roll\_annual\_volatility 2 | ==================================================== 3 | 4 | .. currentmodule:: fynance.features.metrics 5 | 6 | .. autofunction:: roll_annual_volatility -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.econometric_models.get_parameters.rst: -------------------------------------------------------------------------------- 1 | fynance\.models\.econometric\_models\.get\_parameters 2 | ===================================================== 3 | 4 | .. currentmodule:: fynance.models.econometric_models 5 | 6 | .. autofunction:: get_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.to 4 | ============================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.to -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiNeuralNet.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiNeuralNet.run 4 | ============================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiNeuralNet.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollNeuralNet.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollNeuralNet.__call__ 4 | ============================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollNeuralNet.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.cpu 4 | =============================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollNeuralNet.plot_loss.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollNeuralNet.plot_loss 4 | =============================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollNeuralNet.plot_loss -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollNeuralNet.plot_perf.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollNeuralNet.plot_perf 4 | =============================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollNeuralNet.plot_perf -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.apply 4 | ================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.cuda 4 | ================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.eval 4 | ================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.float 4 | ================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.half 4 | ================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.train 4 | ================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.type 4 | ================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.type -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.double 4 | ================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.to 4 | ================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.to -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.run 4 | ================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiRollNeuralNet.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiRollNeuralNet.run 4 | ================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiRollNeuralNet.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.buffers 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.forward 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.modules 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.predict 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.cpu 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.run 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.run -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiNeuralNet.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiNeuralNet.__call__ 4 | =================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiNeuralNet.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.__call__ 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.children 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.set_data 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.set_seed 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.train_on 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.train_on -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.cuda 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.eval 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.half 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.save.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.save 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.save -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.type 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.type -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiNeuralNet.plot_loss.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiNeuralNet.plot_loss 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiNeuralNet.plot_loss -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiNeuralNet.plot_perf.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiNeuralNet.plot_perf 4 | ==================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiNeuralNet.plot_perf -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.add_module 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.extra_repr 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.load_model 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.parameters 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.save_model 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.state_dict 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.zero_grad 4 | ===================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.cpu 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.to 4 | ===================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.to -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.apply 4 | ===================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.double 4 | ====================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.float 4 | ===================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.train 4 | ===================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.cuda 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.eval 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.half 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.type 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.type -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.buffers 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.forward 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.modules 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.pre_run.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.pre_run 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.pre_run -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.predict 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.__call__ 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiRollNeuralNet.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiRollNeuralNet.__call__ 4 | ======================================================= 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiRollNeuralNet.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.share_memory 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.apply 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.float 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.train 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.__call__ 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.children 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.set_data 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.set_seed 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.train_on 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.train_on -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.aggregate.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.aggregate 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.aggregate -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.plot_loss.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.plot_loss 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.plot_loss -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.plot_perf.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.plot_perf 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.plot_perf -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiRollNeuralNet.plot_loss.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiRollNeuralNet.plot_loss 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiRollNeuralNet.plot_loss -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiRollNeuralNet.plot_perf.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollMultiRollNeuralNet.plot_perf 4 | ======================================================== 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollMultiRollNeuralNet.plot_perf -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.named_buffers 4 | ========================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.named_modules 4 | ========================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.set_optimizer 4 | ========================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.double 4 | ========================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.zero_grad 4 | ========================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.load_state_dict 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.named_children 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.register_buffer 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.__call__ 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.buffers 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.children 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.forward 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.modules 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.predict 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.set_data 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.set_seed 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.train_on 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.train_on -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.add_module 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.extra_repr 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.load_model 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.parameters 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.save_model 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.state_dict 4 | ========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.sub_predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.sub_predict 4 | =========================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.sub_predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.named_parameters 4 | ============================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.set_lr_scheduler 4 | ============================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.zero_grad 4 | ============================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.share_memory 4 | ============================================================ 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.set_aggregate.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.neural_networks.RollAggrMultiNeuralNet.set_aggregate 4 | ============================================================ 5 | 6 | .. currentmodule:: fynance.neural_networks 7 | 8 | .. automethod:: RollAggrMultiNeuralNet.set_aggregate -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.add_module 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.extra_repr 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.load_model 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.parameters 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.save_model 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.state_dict 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.to 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.to -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.named_buffers 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.named_modules 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.set_optimizer 4 | ============================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.register_parameter 4 | ============================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.register_parameter -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.cpu 4 | ============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.to 4 | ============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.to -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.named_children 4 | ============================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.named_buffers 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.named_modules 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.set_optimizer 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.share_memory 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.apply 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.cuda 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.eval 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.float 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.half 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.train 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.type 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.type -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.cpu 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.cuda 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.eval 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.half 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.type 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.type -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.load_state_dict 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.named_parameters 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.register_buffer 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.set_lr_scheduler 4 | ================================================================ 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.set_roll_period.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.set_roll_period 4 | =============================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.set_roll_period -------------------------------------------------------------------------------- /doc/source/backtest.rst: -------------------------------------------------------------------------------- 1 | ------------------------------------ 2 | BackTest (:mod:`fynance.backtest`) 3 | ------------------------------------ 4 | 5 | Different tools to backtest or analyze financial strategies or models. 6 | 7 | .. automodule:: fynance.backtest 8 | :no-members: 9 | :no-inherited-members: 10 | :no-special-members: 11 | 12 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.register_forward_hook 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.register_forward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.named_children 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.double 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.apply 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.float 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.train 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.to.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.to 4 | ================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.to -------------------------------------------------------------------------------- /doc/source/_templates/indexsidebar.html: -------------------------------------------------------------------------------- 1 | 2 |

See Also

3 | -------------------------------------------------------------------------------- /doc/source/backtest.tools.rst: -------------------------------------------------------------------------------- 1 | ***************** 2 | Backtesting tools 3 | ***************** 4 | 5 | Some tools to display strategy's performances, rolling sharpe or drawdowns and other some metrics and statistics. 6 | 7 | Tools 8 | ===== 9 | 10 | .. autosummary:: 11 | 12 | fynance.backtest.display_perf 13 | fynance.backtest.set_text_stats 14 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.register_backward_hook 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.register_backward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.load_state_dict 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.register_buffer 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.buffers 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.forward 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.modules 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.predict 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.double 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cpu.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cpu 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.cpu -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.register_parameter 4 | ================================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.register_parameter -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.named_parameters 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.set_lr_scheduler 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.__call__ 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.children 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_data 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_seed 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.train_on 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.train_on -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.buffers 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.forward 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.modules 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.predict 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cuda.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.cuda 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.cuda -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.eval.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.eval 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.eval -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.half.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.half 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.half -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.type.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.type 4 | =================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.type -------------------------------------------------------------------------------- /doc/source/models.rst: -------------------------------------------------------------------------------- 1 | ------------------------------------------ 2 | Financial models (:mod:`fynance.models`) 3 | ------------------------------------------ 4 | 5 | Several financial models (deep learning, econometric, statistic etc.). 6 | 7 | .. automodule:: fynance.models 8 | :no-members: 9 | :no-inherited-members: 10 | :no-special-members: 11 | -------------------------------------------------------------------------------- /fynance/tests/features/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-10-15 16:33:30 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-10-15 16:34:22 8 | 9 | # Built-in packages 10 | 11 | # Third party packages 12 | 13 | # Local packages 14 | -------------------------------------------------------------------------------- /fynance/tests/models/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-01-30 17:25:57 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-10-15 16:32:51 8 | 9 | # Built-in packages 10 | 11 | # Third party packages 12 | 13 | # Local packages 14 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.BaseNeuralNet.register_forward_pre_hook 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: BaseNeuralNet.register_forward_pre_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.register_parameter 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.register_parameter -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.add_module 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.extra_repr 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_model 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.parameters 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.save_model 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.state_dict 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.zero_grad 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.__call__ 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.children 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.set_data 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.set_seed 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.train_on 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.train_on -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.zero_grad 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.apply.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.apply 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.apply -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.double.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.double 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.double -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.float.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.float 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.float -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train 4 | ==================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.train -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.register_forward_hook 4 | ===================================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.register_forward_hook -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Files to ignore 2 | setup.cfg 3 | _how_to_make_dist.txt 4 | fynance/version.py 5 | 6 | # Extensions to ignore 7 | *.so 8 | *.html 9 | *.ipynb_checkpoints 10 | *.pyc 11 | 12 | # Folders to ignore 13 | env/ 14 | build/ 15 | fynance.egg-info/ 16 | dist/ 17 | old_scripts/ 18 | dev/ 19 | 20 | # Cache to ignore 21 | __pycache__/ 22 | .cache/ 23 | .pytest_cache/ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.add_module 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.extra_repr 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.load_model 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.parameters 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.save_model 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.state_dict 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.buffers 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.forward.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.forward 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.forward -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.modules 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.predict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.predict 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.predict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.register_backward_hook 4 | ====================================================================== 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.register_backward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.share_memory 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.__call__.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.__call__ 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.__call__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.children 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_data.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_data 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.set_data -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_seed.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_seed 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.set_seed -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train_on.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.train_on 4 | ======================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.train_on -------------------------------------------------------------------------------- /doc/source/algorithms.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------- 2 | Financial algorithms (:mod:`fynance.algorithms`) 3 | -------------------------------------------------- 4 | 5 | Several financial algorithms (portfolio allocation, etc.). 6 | 7 | .. automodule:: fynance.algorithms 8 | :no-members: 9 | :no-inherited-members: 10 | :no-special-members: 11 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.register_forward_hook 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.register_forward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_buffers 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_modules 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_optimizer 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.share_memory 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.zero_grad.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.zero_grad 4 | ======================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.zero_grad -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.register_backward_hook 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.register_backward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.load_state_dict 4 | ========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_children 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_buffer 4 | ========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.named_buffers 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.named_children 4 | ========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.named_modules 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.set_optimizer 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.add_module.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.add_module 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.add_module -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.extra_repr.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.extra_repr 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.extra_repr -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_model 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.load_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.parameters 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.save_model.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.save_model 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.save_model -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.state_dict 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.rolling.RollMultiLayerPerceptron.register_forward_pre_hook 4 | ========================================================================= 5 | 6 | .. currentmodule:: fynance.models.rolling 7 | 8 | .. automethod:: RollMultiLayerPerceptron.register_forward_pre_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.named_parameters 4 | =========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.set_lr_scheduler 4 | =========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.load_state_dict 4 | =========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.register_buffer 4 | =========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.share_memory.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.share_memory 4 | =========================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.share_memory -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.neural_network.MultiLayerPerceptron.register_forward_pre_hook 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.neural_network 7 | 8 | .. automethod:: MultiLayerPerceptron.register_forward_pre_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.named_parameters 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.set_lr_scheduler 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_buffers.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_buffers 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.named_buffers -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_modules.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_modules 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.named_modules -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_optimizer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_optimizer 4 | ============================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.set_optimizer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_parameter 4 | ============================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.register_parameter -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_children.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_children 4 | ============================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.named_children -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.register_parameter 4 | ============================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.register_parameter -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_state_dict.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.load_state_dict 4 | ============================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.load_state_dict -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_parameters.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.named_parameters 4 | =============================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.named_parameters -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_buffer.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_buffer 4 | ============================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.register_buffer -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_lr_scheduler.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.set_lr_scheduler 4 | =============================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.set_lr_scheduler -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_hook 4 | ================================================================================ 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.register_forward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_backward_hook 4 | ================================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.register_backward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_hook 4 | ================================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.register_forward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_parameter.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_parameter 4 | ================================================================================= 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.register_parameter -------------------------------------------------------------------------------- /doc/source/neural_networks.rst: -------------------------------------------------------------------------------- 1 | -------------------------------------------------- 2 | Neural Networks (:mod:`fynance.neural_networks`) 3 | -------------------------------------------------- 4 | 5 | Several kind of neural networks and tools to applied them to financial strategies. 6 | 7 | .. automodule:: fynance.neural_networks 8 | :no-members: 9 | :no-inherited-members: 10 | :no-special-members: 11 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.register_backward_hook 4 | ================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.register_backward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.GatedRecurrentUnit.register_forward_pre_hook 4 | ==================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: GatedRecurrentUnit.register_forward_pre_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_hook 4 | ==================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.register_forward_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.LongShortTermMemory.register_forward_pre_hook 4 | ===================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: LongShortTermMemory.register_forward_pre_hook -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_backward_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_backward_hook 4 | ===================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.register_backward_hook -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | notifications: 2 | email: false 3 | language: python 4 | os: linux 5 | python: 6 | - "3.6" 7 | - "3.7" 8 | - "3.8" 9 | - "3.9" 10 | #before_install: 11 | # - cd Fynance && python setup.py build_ext --inplace 12 | # command to install dependencies 13 | install: 14 | - pip install -r requirements.txt > /dev/null 2>&1 15 | - python3 setup.py build_ext --inplace 16 | # command to run tests 17 | script: 18 | - pytest -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | formats: 3 | - htmlzip 4 | build: 5 | image: latest 6 | python: 7 | version: 3.6 8 | install: 9 | - requirements: doc-requirements.txt 10 | - method: setuptools 11 | path: . 12 | system_packages: true 13 | submodules: 14 | include: all 15 | recursive: true 16 | sphinx: 17 | builder: html 18 | configuration: doc/source/conf.py 19 | fail_on_warning: False 20 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_pre_hook.rst: -------------------------------------------------------------------------------- 1 | :orphan: 2 | 3 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.register_forward_pre_hook 4 | ======================================================================================== 5 | 6 | .. currentmodule:: fynance.models.recurrent_neural_network 7 | 8 | .. automethod:: RecurrentNeuralNetwork.register_forward_pre_hook -------------------------------------------------------------------------------- /fynance/core/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2021-04-05 20:35:18 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2021-04-05 20:35:21 8 | 9 | """ Description. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | 15 | # Local packages 16 | 17 | __all__ = [] 18 | 19 | 20 | if __name__ == "__main__": 21 | pass -------------------------------------------------------------------------------- /doc/source/_templates/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "!layout.html" %} 2 | 3 | {% block sidebarsearch %} 4 | {%- if sourcename %} 5 | 12 | {%- endif %} 13 | {{ super() }} 14 | {% endblock %} -------------------------------------------------------------------------------- /doc/source/features.roll_functions.rst: -------------------------------------------------------------------------------- 1 | ******************* 2 | Rolling Functions 3 | ******************* 4 | 5 | This module contains some tools to compute rolling functions, such as rolling minimum (:func:`~fynance.features.roll_functions.roll_min`) and rolling maximum (:func:`~fynance.features.roll_functions.roll_max`). 6 | 7 | .. currentmodule:: fynance.features.roll_functions 8 | 9 | Minimum and maximum 10 | =================== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.features.roll_functions.roll_min 16 | fynance.features.roll_functions.roll_max 17 | -------------------------------------------------------------------------------- /fynance/neural_networks/README.md: -------------------------------------------------------------------------------- 1 | # Neural Network 2 | 3 | ## RollNeuralNet object 4 | 5 | The idea of the Rolling Neural Network is to train the model by followig the temporal structure of the data. By exemple we start to train over 1 year (from 01/01/2000 to 31/12/2000), predict 3 months ahead (from 01/01/2001 to 31/03/2001), and move 3 months ahead to retrain the model (from 01/04/2000 to 31/03/2001) and predict again 3 months ahead (from 01/04/2001 to 30/06/2001), and so on until present. 6 | 7 | ![rolling_mechanism](https://github.com/ArthurBernard/Fynance/blob/master/pictures/rolling_mechanism.png) -------------------------------------------------------------------------------- /fynance/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-09-12 17:54:50 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-11-05 20:22:04 8 | 9 | """ 10 | 11 | .. currentmodule:: fynance.algorithms 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | :caption: Contents: 16 | 17 | algorithms.allocation 18 | 19 | """ 20 | 21 | # Built-in packages 22 | 23 | # Third party packages 24 | 25 | # Local packages 26 | from .allocation import * 27 | 28 | __all__ = allocation.__all__ 29 | -------------------------------------------------------------------------------- /doc/source/backtest.plot_object.rst: -------------------------------------------------------------------------------- 1 | ***************** 2 | Plotting backtest 3 | ***************** 4 | 5 | Objects to plot backtest of financial strategies and models (:func:`~fynance.backtest.PlotBackTest`). There is also an object to plot dynamicaly backtest (:func:`~fynance.backtest.DynaPlotBackTest`), i.e. the backtest results are progressively ploted along the computation are done. 6 | 7 | Static object 8 | ============= 9 | 10 | .. autosummary:: 11 | 12 | fynance.backtest.PlotBackTest 13 | 14 | Dynamic object 15 | ============== 16 | 17 | .. autosummary:: 18 | 19 | fynance.backtest.DynaPlotBackTest -------------------------------------------------------------------------------- /doc/source/generated/fynance.features.scale.Scale.rst: -------------------------------------------------------------------------------- 1 | fynance.features.scale.Scale 2 | ============================ 3 | 4 | .. currentmodule:: fynance.features.scale 5 | 6 | .. autoclass:: Scale 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | Scale.__call__ 17 | Scale.fit 18 | Scale.revert 19 | Scale.scale 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /doc/source/models.rolling.rst: -------------------------------------------------------------------------------- 1 | ************** 2 | Rolling models 3 | ************** 4 | 5 | Some tools/objects to roll a model, currently this object work only with neural network models with PyTorch package. You can find in :mod:`fynance.neural_network` some other rolling neural network working with Keras (Tensorflow or Theano). And you can also find in :mod:`fynance.algorithms.allocation` a function to roll some portfolio allocation algorithms. 6 | 7 | .. currentmodule:: fynance.models.rolling 8 | 9 | .. autosummary:: 10 | :toctree: generated/ 11 | 12 | fynance.models.rolling._RollingBasis 13 | fynance.models.rolling.RollMultiLayerPerceptron 14 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling._RollingBasis.rst: -------------------------------------------------------------------------------- 1 | fynance.models.rolling._RollingBasis 2 | ==================================== 3 | 4 | .. currentmodule:: fynance.models.rolling 5 | 6 | .. autoclass:: _RollingBasis 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | _RollingBasis.__call__ 17 | _RollingBasis.pre_run 18 | _RollingBasis.run 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollNeuralNet.rst: -------------------------------------------------------------------------------- 1 | fynance.neural_networks.RollNeuralNet 2 | ===================================== 3 | 4 | .. currentmodule:: fynance.neural_networks 5 | 6 | .. autoclass:: RollNeuralNet 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RollNeuralNet.__call__ 17 | RollNeuralNet.plot_loss 18 | RollNeuralNet.plot_perf 19 | RollNeuralNet.run 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiNeuralNet.rst: -------------------------------------------------------------------------------- 1 | fynance.neural_networks.RollMultiNeuralNet 2 | ========================================== 3 | 4 | .. currentmodule:: fynance.neural_networks 5 | 6 | .. autoclass:: RollMultiNeuralNet 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RollMultiNeuralNet.__call__ 17 | RollMultiNeuralNet.plot_loss 18 | RollMultiNeuralNet.plot_perf 19 | RollMultiNeuralNet.run 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /fynance/backtest/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | 6 | Some tools to backtest strategies 7 | 8 | .. currentmodule:: fynance.backtest 9 | 10 | .. toctree:: 11 | :maxdepth: 1 12 | :caption: Contents: 13 | 14 | backtest.tools 15 | backtest.plot_object 16 | 17 | """ 18 | 19 | from . import print_stats 20 | from .print_stats import * 21 | from . import plot_tools 22 | from .plot_tools import * 23 | from . import plot_backtest 24 | from .plot_backtest import * 25 | from . import dynamic_plot_backtest 26 | from .dynamic_plot_backtest import * 27 | 28 | __all__ = print_stats.__all__ 29 | __all__ += plot_tools.__all__ 30 | __all__ += plot_backtest.__all__ 31 | __all__ += dynamic_plot_backtest.__all__ -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollMultiRollNeuralNet.rst: -------------------------------------------------------------------------------- 1 | fynance.neural_networks.RollMultiRollNeuralNet 2 | ============================================== 3 | 4 | .. currentmodule:: fynance.neural_networks 5 | 6 | .. autoclass:: RollMultiRollNeuralNet 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RollMultiRollNeuralNet.__call__ 17 | RollMultiRollNeuralNet.plot_loss 18 | RollMultiRollNeuralNet.plot_perf 19 | RollMultiRollNeuralNet.run 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /fynance/models/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-02-18 18:43:15 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-09-28 13:54:20 8 | 9 | """ Some deep learning, econometric, statistic and/or financial models. 10 | 11 | .. currentmodule:: fynance.models 12 | 13 | .. toctree:: 14 | 15 | models.econometric_models 16 | models.neural_network 17 | models.rolling 18 | 19 | """ 20 | 21 | from .econometric_models import * 22 | from .econometric_models_cy import * 23 | from .neural_network import * 24 | from .rolling import * 25 | 26 | __all__ = econometric_models.__all__ 27 | __all__ += econometric_models_cy.__all__ 28 | __all__ += neural_network.__all__ 29 | __all__ += rolling.__all__ 30 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.neural_networks.RollAggrMultiNeuralNet.rst: -------------------------------------------------------------------------------- 1 | fynance.neural_networks.RollAggrMultiNeuralNet 2 | ============================================== 3 | 4 | .. currentmodule:: fynance.neural_networks 5 | 6 | .. autoclass:: RollAggrMultiNeuralNet 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RollAggrMultiNeuralNet.__call__ 17 | RollAggrMultiNeuralNet.aggregate 18 | RollAggrMultiNeuralNet.plot_loss 19 | RollAggrMultiNeuralNet.plot_perf 20 | RollAggrMultiNeuralNet.run 21 | RollAggrMultiNeuralNet.set_aggregate 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doc/source/_templates/searchbox.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/searchbox.html 3 | ~~~~~~~~~~~~~~~~~~~~ 4 | 5 | Sphinx sidebar template: quick search box. 6 | 7 | :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- if pagename != "search" and builder != "singlehtml" %} 11 | 22 | 23 | {%- endif %} -------------------------------------------------------------------------------- /doc/source/models.neural_network.rst: -------------------------------------------------------------------------------- 1 | ********************* 2 | Neural network models 3 | ********************* 4 | 5 | Some basis of neural network models with PyTorch package: Multi-Layer Perceptron (:func:`~fynance.models.neural_network.MultiLayerPerceptron`). 6 | 7 | .. currentmodule:: fynance.models.neural_network 8 | 9 | Neural networks 10 | =============== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.models.neural_network.BaseNeuralNet 16 | fynance.models.neural_network.MultiLayerPerceptron 17 | 18 | .. currentmodule:: fynance.models.recurrent_neural_network 19 | 20 | Recurrent neural networks 21 | ========================= 22 | 23 | .. autosummary:: 24 | :toctree: generated/ 25 | 26 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork 27 | fynance.models.recurrent_neural_network.GatedRecurrentUnit 28 | fynance.models.recurrent_neural_network.LongShortTermMemory 29 | -------------------------------------------------------------------------------- /doc/source/neural_networks.rolling_neural_networks.rst: -------------------------------------------------------------------------------- 1 | *********************** 2 | Rolling Neural Networks 3 | *********************** 4 | 5 | The main idea behind Rolling Neural Network is to train the model by followig the temporal structure of the data. By example we start to train over 1 year (from 01/01/2000 to 31/12/2000), predict 3 months ahead (from 01/01/2001 to 31/03/2001), and move 3 months ahead to retrain the model (from 01/04/2000 to 31/03/2001) and predict again 3 months ahead (from 01/04/2001 to 30/06/2001), and so on until present. 6 | 7 | .. image:: _static/rolling_mechanism.png 8 | 9 | Rolling neural networks with Keras 10 | ================================== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.neural_networks.RollNeuralNet 16 | fynance.neural_networks.RollMultiNeuralNet 17 | fynance.neural_networks.RollAggrMultiNeuralNet 18 | fynance.neural_networks.RollMultiRollNeuralNet 19 | -------------------------------------------------------------------------------- /doc/source/models.econometric_models.rst: -------------------------------------------------------------------------------- 1 | ****************** 2 | Econometric models 3 | ****************** 4 | 5 | Currently contians four econometric models: Moving Average (:func:`~fynance.models.econometric_models.MA`), Auto Regressive with Moving Average (:func:`~fynance.models.econometric_models.ARMA`), Generalized Auto Regressive with Conditional Heteroskedasticity (:func:`~fynance.models.econometric_models.ARMA_GARCH` and :func:`~fynance.models.econometric_models.ARMAX_GARCH`). 6 | 7 | .. currentmodule:: fynance.models.econometric_models 8 | 9 | Time series models 10 | ================== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.models.econometric_models.MA 16 | fynance.models.econometric_models.ARMA 17 | fynance.models.econometric_models.ARMA_GARCH 18 | fynance.models.econometric_models.ARMAX_GARCH 19 | 20 | 21 | Tools 22 | ===== 23 | 24 | .. autosummary:: 25 | :toctree: generated/ 26 | 27 | fynance.models.econometric_models.get_parameters 28 | -------------------------------------------------------------------------------- /doc/source/features.indicators.rst: -------------------------------------------------------------------------------- 1 | ********** 2 | Indicators 3 | ********** 4 | 5 | Some tools to compute financial indicators. Currently contains the Bollinger Band (:func:`~fynance.features.indicators.bollinger_band`), Commodity Channel Index (:func:`~fynance.features.indicators.cci`), Hull Moving Average (:func:`~fynance.features.indicators.hma`), Moving Average Convergence Divergence (:func:`~fynance.features.indicators.macd_hist`, :func:`~fynance.features.indicators.macd_line`, :func:`~fynance.features.indicators.signal_line`), and Relative Strenght Index (:func:`~fynance.features.indicators.rsi`). 6 | 7 | .. currentmodule:: fynance.features.indicators 8 | 9 | Financial indicators 10 | ==================== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.features.indicators.bollinger_band 16 | fynance.features.indicators.cci 17 | fynance.features.indicators.hma 18 | fynance.features.indicators.macd_hist 19 | fynance.features.indicators.macd_line 20 | fynance.features.indicators.rsi 21 | fynance.features.indicators.signal_line 22 | -------------------------------------------------------------------------------- /doc/source/features.momentums.rst: -------------------------------------------------------------------------------- 1 | *********** 2 | Momentums 3 | *********** 4 | 5 | This module contains some tools to compute moving statistic momentums, such as three kind of moving average: simple (:func:`~fynance.features.momentums.sma`), exponential (:func:`~fynance.features.momentums.ema`) and weighted (:func:`~fynance.features.momentums.wma`); and three kind of moving standard deviation: simple (:func:`~fynance.features.momentums.smstd`), exponential (:func:`~fynance.features.momentums.emstd`) and weighted (:func:`~fynance.features.momentums.wmstd`). 6 | 7 | .. currentmodule:: fynance.features.momentums 8 | 9 | Moving averages 10 | =============== 11 | 12 | .. autosummary:: 13 | :toctree: generated/ 14 | 15 | fynance.features.momentums.ema 16 | fynance.features.momentums.sma 17 | fynance.features.momentums.wma 18 | 19 | Moving standard deviation 20 | ========================= 21 | 22 | .. autosummary:: 23 | :toctree: generated/ 24 | 25 | fynance.features.momentums.emstd 26 | fynance.features.momentums.smstd 27 | fynance.features.momentums.wmstd 28 | -------------------------------------------------------------------------------- /fynance/_exceptions.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-10-23 17:01:36 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-10-23 17:17:32 8 | 9 | """ Define some various richly-typed exceptions. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | 15 | # Local packages 16 | 17 | 18 | class ArraySizeError(ValueError, IndexError): 19 | """ Size of the array was invalid. """ 20 | 21 | def __init__(self, size, axis=None, min_size=None, msg_prefix=None): 22 | """ Initialize the array size error. """ 23 | msg = 'array of size {}'.format(size) 24 | 25 | if axis is not None: 26 | msg += ' in axis {}'.format(axis) 27 | 28 | msg += ' is not allowed' 29 | 30 | if min_size is not None: 31 | msg += ', minimum size is {}'.format(min_size) 32 | 33 | if msg_prefix is not None: 34 | msg = '{}: {}'.format(msg_prefix, msg) 35 | 36 | super(ArraySizeError, self).__init__(msg) 37 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018-2019 Arthur Bernard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /doc/source/features.scale.rst: -------------------------------------------------------------------------------- 1 | ******* 2 | Scale 3 | ******* 4 | 5 | This module contains some tools to scale data set, such as standardization (:func:`~fynance.features.scale.standardize`), normalization (:func:`~fynance.features.scale.normalize`) and rolling versions (:func:`~fynance.features.scale.roll_standardize` and :func:`~fynance.features.scale.roll_normalize`). 6 | 7 | There is also a scale object (:func:`~fynance.features.scale.Scale`) that allows you to scale your data with standardization or normalization and keep in memory the parameters used to scale the data. Such that you can rescale an other data set with the same parameters or you can also revert the scale transformation. 8 | 9 | .. currentmodule:: fynance.features.scale 10 | 11 | Scale functions 12 | =============== 13 | 14 | .. autosummary:: 15 | :toctree: generated/ 16 | 17 | fynance.features.scale.normalize 18 | fynance.features.scale.standardize 19 | fynance.features.scale.roll_normalize 20 | fynance.features.scale.roll_standardize 21 | 22 | Scale object 23 | ============ 24 | 25 | .. autosummary:: 26 | :toctree: generated/ 27 | 28 | fynance.features.scale.Scale 29 | -------------------------------------------------------------------------------- /doc/source/algorithms.allocation.rst: -------------------------------------------------------------------------------- 1 | ******************** 2 | Portfolio allocation 3 | ******************** 4 | 5 | Currently this module contains only five algorithms: Equal Risk Contribution (:func:`~fynance.algorithms.allocation.ERC`), Hierarchical Risk Parity (:func:`~fynance.algorithms.allocation.HRP`), Inverse Variance Portfolio (:func:`~fynance.algorithms.allocation.IVP`), Maximum Diversified Portfolio (:func:`~fynance.algorithms.allocation.MDP`), Minimum Variance Portfolio constrained (:func:`~fynance.algorithms.allocation.MVP`) and unconstrained (:func:`~fynance.algorithms.allocation.MVP_uc`). 6 | 7 | The module contains also an object to roll these allocations algorithms (:func:`~fynance.algorithms.allocation.rolling_allocation`). 8 | 9 | .. currentmodule:: fynance.algorithms.allocation 10 | 11 | Allocation algorithms 12 | ===================== 13 | 14 | .. autosummary:: 15 | :toctree: generated/ 16 | 17 | fynance.algorithms.allocation.ERC 18 | fynance.algorithms.allocation.HRP 19 | fynance.algorithms.allocation.IVP 20 | fynance.algorithms.allocation.MDP 21 | fynance.algorithms.allocation.MVP 22 | fynance.algorithms.allocation.MVP_uc 23 | 24 | Rolling object 25 | ============== 26 | 27 | .. autosummary:: 28 | :toctree: generated/ 29 | 30 | fynance.algorithms.allocation.rolling_allocation 31 | -------------------------------------------------------------------------------- /fynance/neural_networks/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-11-05 19:52:23 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-11-07 18:02:18 8 | 9 | """ Some models, tools, etc for neural network 10 | 11 | .. currentmodule:: fynance.neural_networks 12 | 13 | .. toctree:: 14 | :maxdepth: 1 15 | :caption: Contents: 16 | 17 | neural_networks.rolling_neural_networks 18 | 19 | """ 20 | 21 | # Built-in packages 22 | 23 | # Third party packages 24 | 25 | # Local packages 26 | from . import roll_neural_network 27 | from .roll_neural_network import RollNeuralNet 28 | from . import roll_multi_neural_networks 29 | from .roll_multi_neural_networks import RollMultiNeuralNet 30 | from . import roll_aggregated_multi_neural_networks 31 | from .roll_aggregated_multi_neural_networks import RollAggrMultiNeuralNet 32 | from . import roll_multi_roll_neural_networks 33 | from .roll_multi_roll_neural_networks import RollMultiRollNeuralNet 34 | #from . import set_neuralnetwork_tools 35 | #from .set_neuralnetwork_tools import * 36 | 37 | __all__ = ['RollNeuralNet'] 38 | __all__ += ['RollMultiNeuralNet'] 39 | __all__ += ['RollAggrMultiNeuralNet'] 40 | __all__ += ['RollMultiRollNeuralNet'] 41 | # TODO : dev setter function 42 | #__all__ += set_neuralnetwork_tools.__all__ -------------------------------------------------------------------------------- /doc/source/_templates/autosummary/class.rst: -------------------------------------------------------------------------------- 1 | {{ fullname }} 2 | {{ underline }} 3 | 4 | .. currentmodule:: {{ module }} 5 | 6 | .. autoclass:: {{ objname }} 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | {% block methods %} 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | {% for item in all_methods %} 16 | {%- if not item.startswith('_') or item in ['__call__', '__mul__', '__getitem__', '__len__'] %} 17 | {{ name }}.{{ item }} 18 | {%- endif -%} 19 | {%- endfor %} 20 | {% for item in inherited_members %} 21 | {%- if item in ['__call__', '__mul__', '__getitem__', '__len__'] %} 22 | {{ name }}.{{ item }} 23 | {%- endif -%} 24 | {%- endfor %} 25 | {% endblock %} 26 | 27 | {% block attributes %} 28 | {% if attributes %} 29 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 30 | .. autosummary:: 31 | :toctree: 32 | {% for item in all_attributes %} 33 | {%- if not item.startswith('_') %} 34 | {{ name }}.{{ item }} 35 | {%- endif -%} 36 | {%- endfor %} 37 | {% endif %} 38 | {% endblock %} 39 | -------------------------------------------------------------------------------- /fynance/algorithms/browsers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2020-09-25 19:08:48 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2020-10-02 21:52:02 8 | 9 | """ Basis objects to browse data. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | import numpy as np 15 | 16 | # Local packages 17 | from .browsers_cy import * 18 | 19 | __all__ = ["BrowserData"] 20 | 21 | 22 | class BrowserData: 23 | def __init__(self, X, start=0, end=None, step=1, shuffle=False): 24 | # super(BrowserData, self).__init__(X, step, start) 25 | self.end = X[0] if end is None else end 26 | 27 | if not shuffle: 28 | self.generator = range(start, self.end, step) 29 | 30 | else: 31 | self.idx = np.arange(start, self.end, step) 32 | 33 | self.X = X 34 | self.step = step 35 | self.shuffle = shuffle 36 | 37 | def __iter__(self): 38 | if self.shuffle: 39 | np.random.shuffle(self.idx) 40 | self.generator = (x for x in self.idx) 41 | 42 | return self.generator.__iter__() 43 | 44 | def __next__(self): 45 | # return _BrowserXCy.__next__(self) 46 | i = self.generator.__next__() 47 | 48 | return self.X[i: i + self.step] 49 | 50 | 51 | class RollingBasis: 52 | def __init__(self, start, end, step): 53 | pass 54 | 55 | 56 | if __name__ == "__main__": 57 | pass 58 | -------------------------------------------------------------------------------- /fynance/features/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-09-28 13:58:30 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2020-09-18 21:37:49 8 | 9 | """ Module with some financial, statistic and econometric tools to extract 10 | features. 11 | 12 | .. currentmodule:: fynance.features 13 | 14 | .. toctree:: 15 | :maxdepth: 1 16 | :caption: Contents: 17 | 18 | features.indicators 19 | features.metrics 20 | features.momentums 21 | features.roll_functions 22 | features.scale 23 | 24 | """ 25 | 26 | # Cython imports 27 | from . import metrics_cy 28 | from .metrics_cy import * 29 | from . import metrics 30 | from .metrics import * 31 | from . import momentums_cy 32 | from .momentums_cy import * 33 | from . import roll_functions_cy 34 | from .roll_functions_cy import * 35 | 36 | # Python imports 37 | from . import momentums 38 | from .momentums import * 39 | from . import indicators 40 | from .indicators import * 41 | from . import money_management 42 | from .money_management import * 43 | from . import roll_functions 44 | from .roll_functions import * 45 | from . import scale 46 | from .scale import * 47 | 48 | __all__ = metrics_cy.__all__ 49 | __all__ += metrics.__all__ 50 | __all__ += momentums_cy.__all__ 51 | __all__ += momentums.__all__ 52 | __all__ += indicators.__all__ 53 | __all__ += money_management.__all__ 54 | __all__ += roll_functions_cy.__all__ 55 | __all__ += roll_functions.__all__ 56 | __all__ += scale.__all__ 57 | -------------------------------------------------------------------------------- /fynance/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-02-15 12:50:12 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-11-05 16:55:36 8 | 9 | """ 10 | Fynance : A Python package for quant financial research 11 | ======================================================= 12 | 13 | Documentation is available at 14 | https://fynance.readthedocs.io/en/latest/index.html. 15 | 16 | Contents 17 | -------- 18 | Fynance is a python/cython project that includes several machine learning, 19 | econometric and statistical subpackages specialy adapted for financial 20 | analysis, portfolio allocation, and backtest trading strategies. 21 | 22 | Subpackages 23 | ----------- 24 | algorithms --- Financial algorithms 25 | backtest --- Backtest strategy tools 26 | features --- Features extraction 27 | models --- Econometric and Neural Network models (using PyTorch) 28 | neural_networks --- Neural network models (using Keras) 29 | 30 | Utility tools 31 | ------------- 32 | _exceptions --- Fynance exceptions 33 | tests --- Run fynance unittests 34 | _wrappers --- Fynance wrapper functions 35 | 36 | """ 37 | 38 | from .version import version as __version__ 39 | 40 | __all__ = ['__version__'] 41 | 42 | from .models import * 43 | from .estimator import * 44 | from .features import * 45 | from .neural_networks import * 46 | from .backtest import * 47 | from .algorithms import * 48 | 49 | __all__ += models.__all__ 50 | __all__ += estimator.__all__ 51 | __all__ += features.__all__ 52 | __all__ += neural_networks.__all__ 53 | __all__ += backtest.__all__ 54 | __all__ += algorithms.__all__ 55 | -------------------------------------------------------------------------------- /fynance/models/basis.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2020-09-12 09:15:33 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2020-09-12 10:22:09 8 | 9 | """ Script with basic models. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | import numpy as np 15 | 16 | # Local packages 17 | 18 | __all__ = [] 19 | 20 | 21 | def _prob_sign(X): 22 | X_ = np.ones(X.shape) 23 | X_[X < 0.5] = -1. 24 | 25 | return X_ 26 | 27 | 28 | class SignalModel: 29 | r""" A basic model designed to estimate signals. 30 | 31 | Parameters 32 | ---------- 33 | pred : str {'sign', 'proba'}, optional 34 | - 'sign' (default) means the prediction is positive or negative and 35 | keep only the sign to compute the signal time series, i.e 36 | :math:`signal = 1 \text{ if y > 0} -1 \text{ otherwise}`. 37 | - 'prob' means the prediction is the probability to get a positive 38 | signal, i.e 39 | :math:`signal = 1 \text{ if y > 0.5} -1 \text{ otherwise}`. 40 | 41 | """ 42 | 43 | handle_func_signal = { 44 | "sign": np.sign, 45 | "prob": _prob_sign, 46 | } 47 | 48 | def __init__(self, pred='sign'): 49 | """ Initialize the signal model object. """ 50 | self.pred = pred 51 | self._get_signal = self.handle_func_signal[pred] 52 | 53 | def get_signal(self): 54 | """ Compute signal of prediction. """ 55 | return self._get_signal(self.y_pred) 56 | 57 | 58 | class MagnitudeModel: 59 | """ A basic model designed to estimate magnitudes. """ 60 | 61 | pass 62 | 63 | 64 | if __name__ == "__main__": 65 | pass 66 | -------------------------------------------------------------------------------- /fynance/tests/core/series.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2021-04-05 20:35:58 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2021-04-05 21:05:28 8 | 9 | """ Test of series objects. """ 10 | 11 | # Built-in packages 12 | from unittest.mock import MagicMock 13 | 14 | # Third party packages 15 | import numpy as np 16 | import pytest 17 | 18 | # Local packages 19 | from fynance.core.series import Series 20 | 21 | 22 | __all__ = [] 23 | 24 | 25 | @pytest.fixture 26 | def series(): 27 | return Series([1, 2, 3, 4]) 28 | 29 | 30 | @pytest.fixture 31 | def series_ploted(series): 32 | mock_ax = MagicMock() 33 | series.plot(ax=mock_ax) 34 | 35 | return series 36 | 37 | 38 | class TestSeries: 39 | 40 | def test_constructor(self, series): 41 | assert series.plot_series is None 42 | assert str(series) == "[1 2 3 4]" 43 | assert repr(series) == "Series([1, 2, 3, 4])" 44 | assert series[0] == 1 45 | assert series[-1] == 4 46 | assert len(series) == 4 47 | assert series.shape == (4,) 48 | 49 | def test_view_casting(self): 50 | s = np.arange(1, 5).view(Series) 51 | assert isinstance(s, Series) 52 | assert s.plot_series is None 53 | assert repr(s) == "Series([1, 2, 3, 4])" 54 | 55 | def test_new_from_template(self, series_ploted): 56 | s = series_ploted[1:] 57 | assert isinstance(s, Series) 58 | assert s.plot_series is not None 59 | assert repr(s) == "Series([2, 3, 4])" 60 | 61 | def test_append(self): 62 | pass 63 | 64 | def test_plot(self): 65 | pass 66 | 67 | def test_update_plot(self): 68 | pass 69 | 70 | if __name__ == "__main__": 71 | pass 72 | -------------------------------------------------------------------------------- /fynance/features/filters.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-03-28 18:12:52 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-11-05 20:45:41 8 | 9 | """ Some filter functions. """ 10 | 11 | # Built-in packages 12 | 13 | # External packages 14 | import numpy as np 15 | 16 | # Local packages 17 | 18 | 19 | __all__ = [] 20 | 21 | # TODO : to finish kalman filter 22 | 23 | 24 | def kalman(X, distribution='normal'): 25 | """ Compute the Kalman filter. 26 | 27 | /! not yet working /! 28 | 29 | Kalman filter is computed as described in the paper by G. Welch and 30 | G. Bishop [1]_. 31 | 32 | Parameters 33 | ---------- 34 | X : array_like 35 | Observed data. 36 | distribution : str, optional 37 | An available distribution in scipy library. 38 | 39 | Returns 40 | ------- 41 | array_like 42 | Filter of kalman following the given distribution. 43 | 44 | References 45 | ---------- 46 | .. [1] https://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf 47 | 48 | """ 49 | T, n = X.shape 50 | 51 | # Initial estimation 52 | # TODO : Check better initialization 53 | m_0 = 0 54 | C_0 = 1 55 | 56 | # Set variables 57 | # TODO : Check shape of variables 58 | a = np.zeros([T, n]) 59 | R = np.zeros([T, n]) 60 | 61 | for t in range(1, T): 62 | # Time update (predict) 63 | a[t] = G[t] @ m[t - 1] 64 | R[t] = G[t] @ C[t - 1] @ G[t].T + W[t] 65 | 66 | # Measurement update (correct) 67 | A[t] = R[t] @ F[t] @ np.linalg.pinv(F[t] @ R[t] @ F[t].T + V[t]) 68 | m[t] = a[t] + A[t] @ (X[t] - F[t].T @ a[t]) 69 | C[t] = (np.identity(n) - A[t] @ F[t]) @ R[t] 70 | 71 | s_0 = 0 72 | x_0 = X[0] 73 | 74 | x_hat_1 75 | -------------------------------------------------------------------------------- /doc/source/features.rst: -------------------------------------------------------------------------------- 1 | ------------------------------------ 2 | Features (:mod:`fynance.features`) 3 | ------------------------------------ 4 | 5 | .. automodule:: fynance.features 6 | :no-members: 7 | :no-inherited-members: 8 | :no-special-members: 9 | 10 | These modules contain several financial features such as metrics, indicators, scale transformation and also some statistical features as moving averages and moving standard deviations. 11 | 12 | Some precisions about parameters' notation in the following modules: 13 | 14 | - ``X`` is the time-series of returns, prices or indexed values. It can be one or two-dimensional array, if ``X`` is two-dimensional then you can precise the axis along wich make the computation. By default the compuatation is done along axis 0, i.e. each row is an observation at time t and each column is a different time-series. 15 | 16 | - ``w`` is the size of the lagged window, e.g. a simple moving average of ``X`` is noted :math:`sma^w_t(X) = \frac{1}{w} \sum^{w-i}_{i=0} X_{t-i}`. 17 | 18 | - ``kind`` means the method to compute moving average and/or standard deviation, simple ``'s'``, weighted ``'w'`` and exponential ``'e'`` are allowed. 19 | 20 | - ``slow_w`` and ``fast_w`` are the size of the lagged windows for respectively long and short moving averages/standard deviations. 21 | 22 | - ``period`` is the number of period per year of data, e.g in daily data ``period=252`` trading days per year or ``period=365`` days per year, it depends of data. 23 | 24 | - ``axis`` is the axis on which the computation is done. This parameter is relevant only for two-dimensional arrays. By default the compuatation is done along axis 0, i.e. each row is an observation at time t and each column is a different time-series. 25 | 26 | - ``dtype`` is the type of output data in the array, only 'numerical types' are allowed (e.g. ``float``, ``double``, ``int``, ``np.float16``, etc.). By default is None, it infer the data type from ``X`` input. 27 | -------------------------------------------------------------------------------- /fynance/algorithms/rolling.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-09-13 10:27:51 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-09-20 10:08:14 8 | 9 | """ Object to roll algorithms. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | 15 | # Local packages 16 | 17 | __all__ = ['_RollingMechanism'] 18 | 19 | 20 | class _RollingMechanism: 21 | """ Rolling mechanism. """ 22 | 23 | def __init__(self, index, n, s): 24 | """ Initialize object. """ 25 | self.idx = index 26 | self.n = n 27 | self.s = s 28 | 29 | def __call__(self, t=None, T=None, display=True): 30 | self.display = display 31 | # Set initial index 32 | if t is None: 33 | self.t = self.n 34 | 35 | else: 36 | self.t = t 37 | 38 | # Set max index 39 | if T is None: 40 | self.T = self.idx.size 41 | 42 | else: 43 | self.T = T 44 | 45 | return self 46 | 47 | def __iter__(self): 48 | # Iterative method 49 | return self 50 | 51 | def __next__(self): 52 | # Next method 53 | t = self.t 54 | 55 | # Display % 56 | if self.display: 57 | self._display() 58 | 59 | if self.t >= self.T - 1: 60 | 61 | raise StopIteration 62 | 63 | # Update rolling 64 | self.t += self.s 65 | 66 | # Set indexes 67 | self.d_n = self.idx[max(t - self.n, 0)] 68 | self.d_1 = self.idx[t - 1] 69 | self.d = self.idx[t] 70 | self.d_s = self.idx[min(t + self.s, self.T - 1)] 71 | 72 | return slice(self.d_n, self.d_1), slice(self.d, self.d_s) 73 | 74 | def _display(self): 75 | # Display % 76 | pct = (self.t - self.n - self.s) / (self.T - self.n - self.T % self.s) 77 | 78 | print('{:.2%}'.format(pct), end='\r') 79 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.BaseNeuralNet.rst: -------------------------------------------------------------------------------- 1 | fynance.models.neural_network.BaseNeuralNet 2 | =========================================== 3 | 4 | .. currentmodule:: fynance.models.neural_network 5 | 6 | .. autoclass:: BaseNeuralNet 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | BaseNeuralNet.__call__ 17 | BaseNeuralNet.add_module 18 | BaseNeuralNet.apply 19 | BaseNeuralNet.buffers 20 | BaseNeuralNet.children 21 | BaseNeuralNet.cpu 22 | BaseNeuralNet.cuda 23 | BaseNeuralNet.double 24 | BaseNeuralNet.eval 25 | BaseNeuralNet.extra_repr 26 | BaseNeuralNet.float 27 | BaseNeuralNet.forward 28 | BaseNeuralNet.half 29 | BaseNeuralNet.load_model 30 | BaseNeuralNet.load_state_dict 31 | BaseNeuralNet.modules 32 | BaseNeuralNet.named_buffers 33 | BaseNeuralNet.named_children 34 | BaseNeuralNet.named_modules 35 | BaseNeuralNet.named_parameters 36 | BaseNeuralNet.parameters 37 | BaseNeuralNet.predict 38 | BaseNeuralNet.register_backward_hook 39 | BaseNeuralNet.register_buffer 40 | BaseNeuralNet.register_forward_hook 41 | BaseNeuralNet.register_forward_pre_hook 42 | BaseNeuralNet.register_parameter 43 | BaseNeuralNet.save_model 44 | BaseNeuralNet.set_data 45 | BaseNeuralNet.set_lr_scheduler 46 | BaseNeuralNet.set_optimizer 47 | BaseNeuralNet.set_seed 48 | BaseNeuralNet.share_memory 49 | BaseNeuralNet.state_dict 50 | BaseNeuralNet.to 51 | BaseNeuralNet.train 52 | BaseNeuralNet.train_on 53 | BaseNeuralNet.type 54 | BaseNeuralNet.zero_grad 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /fynance/tests/models/test_econometric_models.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-03-01 16:51:38 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-10-15 16:39:37 8 | 9 | # Built-in packages 10 | 11 | # Third party packages 12 | import numpy as np 13 | import pytest 14 | 15 | # local packages 16 | import fynance as fy 17 | 18 | 19 | @pytest.fixture() 20 | def set_variables(): 21 | y = np.array([60, 100, 80, 120, 160, 80]) 22 | params = np.array([0.2, 0.5, -0.3, 0.6, 0.1, 0.1]) 23 | p, q, P, Q = 1, 1, 1, 1 24 | return y, params, p, q, P, Q 25 | 26 | 27 | def test_get_parameters(set_variables): 28 | y, params, p, q, P, Q = set_variables 29 | phi, theta, alpha, beta, c, omega = fy.get_parameters( 30 | params, p, q, P, Q, cons=True 31 | ) 32 | assert c == params[0] 33 | assert phi == params[1] 34 | assert theta == params[2] 35 | assert omega == params[3] 36 | assert alpha == params[4] 37 | assert beta == params[5] 38 | phi, theta, alpha, beta, c, omega = fy.get_parameters( 39 | params, p, q, P, Q, cons=False 40 | ) 41 | assert phi == params[0] 42 | assert theta == params[1] 43 | assert omega == params[2] 44 | assert alpha == params[3] 45 | assert beta == params[4] 46 | 47 | 48 | def test_ARMA_GARCH(set_variables): 49 | y, params, p, q, P, Q = set_variables 50 | u_est, h_est = fy.ARMA_GARCH( 51 | y, phi=params[1:2], theta=params[2:3], alpha=params[4:5], 52 | beta=params[5:6], c=params[0], omega=params[3], p=1, q=1, P=1, Q=1 53 | ) 54 | u = np.zeros([y.size]) 55 | h = np.zeros([y.size]) 56 | u[0] = y[0] - params[0] 57 | h[0] = np.sqrt(params[3]) 58 | assert u[0] == u_est[0] 59 | assert h[0] == h_est[0] 60 | for t in range(1, y.size): 61 | u[t] = y[t] - params[0] - y[t - 1] * params[1] - u[t - 1] * params[2] 62 | h[t] = np.sqrt( 63 | params[3] + params[4] * u[t - 1] ** 2 + params[5] * h[t - 1] ** 2 64 | ) 65 | assert u[t] == u_est[t] 66 | assert h[t] == h_est[t] 67 | -------------------------------------------------------------------------------- /doc/source/features.metrics.rst: -------------------------------------------------------------------------------- 1 | ********* 2 | Metrics 3 | ********* 4 | 5 | This module contains some tools to compute financial metrics, such as annualized returns (:func:`~fynance.features.metrics.annual_return`), annualized volatility (:func:`~fynance.features.metrics.annual_volatility`), Calmar ratio (:func:`~fynance.features.metrics.calmar`), diversification ratio (:func:`~fynance.features.metrics.diversified_ratio`), maximum drawdown (:func:`~fynance.features.metrics.mdd`), Sharpe ratio (:func:`~fynance.features.metrics.sharpe`), Z-score (:func:`~fynance.features.metrics.z_score`), etc. 6 | 7 | There is also rolling version of some metrics, annualized returns (:func:`~fynance.features.metrics.roll_annual_return`), annualized volatility (:func:`~fynance.features.metrics.roll_annual_volatility`), Calmar ratio (:func:`~fynance.features.metrics.roll_calmar`), maximum drawdown (:func:`~fynance.features.metrics.roll_mdd`), Sharpe ratio (:func:`~fynance.features.metrics.roll_sharpe`), Z-score (:func:`~fynance.features.metrics.roll_z_score`), etc. 8 | 9 | .. currentmodule:: fynance.features.metrics 10 | 11 | Classical version of metrics 12 | ============================ 13 | 14 | .. autosummary:: 15 | :toctree: generated/ 16 | 17 | fynance.features.metrics.accuracy 18 | fynance.features.metrics.annual_return 19 | fynance.features.metrics.annual_volatility 20 | fynance.features.metrics.calmar 21 | fynance.features.metrics.diversified_ratio 22 | fynance.features.metrics.drawdown 23 | fynance.features.metrics.mad 24 | fynance.features.metrics.mdd 25 | fynance.features.metrics.perf_index 26 | fynance.features.metrics.perf_returns 27 | fynance.features.metrics.perf_strat 28 | fynance.features.metrics.sharpe 29 | fynance.features.metrics.z_score 30 | 31 | Rolling version of metrics 32 | ========================== 33 | 34 | .. autosummary:: 35 | :toctree: generated/ 36 | 37 | fynance.features.metrics.roll_annual_return 38 | fynance.features.metrics.roll_annual_volatility 39 | fynance.features.metrics.roll_calmar 40 | fynance.features.metrics.roll_drawdown 41 | fynance.features.metrics.roll_mad 42 | fynance.features.metrics.roll_mdd 43 | fynance.features.metrics.roll_sharpe 44 | fynance.features.metrics.roll_z_score 45 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.GatedRecurrentUnit.rst: -------------------------------------------------------------------------------- 1 | fynance.models.recurrent_neural_network.GatedRecurrentUnit 2 | ========================================================== 3 | 4 | .. currentmodule:: fynance.models.recurrent_neural_network 5 | 6 | .. autoclass:: GatedRecurrentUnit 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | GatedRecurrentUnit.__call__ 17 | GatedRecurrentUnit.add_module 18 | GatedRecurrentUnit.apply 19 | GatedRecurrentUnit.buffers 20 | GatedRecurrentUnit.children 21 | GatedRecurrentUnit.cpu 22 | GatedRecurrentUnit.cuda 23 | GatedRecurrentUnit.double 24 | GatedRecurrentUnit.eval 25 | GatedRecurrentUnit.extra_repr 26 | GatedRecurrentUnit.float 27 | GatedRecurrentUnit.forward 28 | GatedRecurrentUnit.half 29 | GatedRecurrentUnit.load_model 30 | GatedRecurrentUnit.load_state_dict 31 | GatedRecurrentUnit.modules 32 | GatedRecurrentUnit.named_buffers 33 | GatedRecurrentUnit.named_children 34 | GatedRecurrentUnit.named_modules 35 | GatedRecurrentUnit.named_parameters 36 | GatedRecurrentUnit.parameters 37 | GatedRecurrentUnit.predict 38 | GatedRecurrentUnit.register_backward_hook 39 | GatedRecurrentUnit.register_buffer 40 | GatedRecurrentUnit.register_forward_hook 41 | GatedRecurrentUnit.register_forward_pre_hook 42 | GatedRecurrentUnit.register_parameter 43 | GatedRecurrentUnit.save_model 44 | GatedRecurrentUnit.set_data 45 | GatedRecurrentUnit.set_lr_scheduler 46 | GatedRecurrentUnit.set_optimizer 47 | GatedRecurrentUnit.set_seed 48 | GatedRecurrentUnit.share_memory 49 | GatedRecurrentUnit.state_dict 50 | GatedRecurrentUnit.to 51 | GatedRecurrentUnit.train 52 | GatedRecurrentUnit.train_on 53 | GatedRecurrentUnit.type 54 | GatedRecurrentUnit.zero_grad 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /fynance/features/money_management.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-03-15 12:23:04 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-11-05 15:56:01 8 | 9 | """ Module with function to compute some money management coefficients. """ 10 | 11 | # Built-in packages 12 | 13 | # External packages 14 | import numpy as np 15 | 16 | # Internal packages 17 | from fynance.features.momentums import ema 18 | 19 | __all__ = ['iso_vol'] 20 | 21 | # =========================================================================== # 22 | # Money-management Tools # 23 | # =========================================================================== # 24 | 25 | 26 | def iso_vol(series, target_vol=0.20, leverage=1., period=252, half_life=11): 27 | """ Make an iso-vol vector to apply to signal vector. 28 | 29 | Parameters 30 | ---------- 31 | series : np.ndarray[ndim=1, dtype=np.float64] 32 | Series of price of underlying. 33 | target_vol : float (default 20 %) 34 | Volatility to target. 35 | leverage : float (default 1) 36 | Max leverage to use. 37 | period : int (default 250) 38 | Number of period per year. 39 | half_life : int (default 11) 40 | Half-life of exponential moving average used to compute volatility. 41 | 42 | Returns 43 | ------- 44 | iv : np.ndarray[ndim=1, dtype=np.float64] 45 | Series of iso-vol coefficient. 46 | 47 | Examples 48 | -------- 49 | >>> series = np.array([95, 100, 85, 105, 110, 90]).astype(np.float64) 50 | >>> iso_vol(series, target_vol=0.5, leverage=2, period=12, half_life=3) 51 | array([1. , 1. , 2. , 1.11289534, 0.88580571, 52 | 1.20664917]) 53 | 54 | """ 55 | # Set iso-vol vector 56 | iv = np.ones([series.size]) 57 | # Compute squared daily return vector 58 | ret2 = np.square(series[:-1] / series[1:] - 1) 59 | # Compute volatility vector 60 | vol = np.sqrt(period * ema(ret2, w=half_life)) 61 | vol[vol <= 0.] = 1e-8 62 | # Compute iso-vol coefficient 63 | iv[2:] = target_vol / vol[:-1] 64 | # Cap with the max leverage available 65 | iv[iv > leverage] = leverage 66 | return iv 67 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.neural_network.MultiLayerPerceptron.rst: -------------------------------------------------------------------------------- 1 | fynance.models.neural_network.MultiLayerPerceptron 2 | ================================================== 3 | 4 | .. currentmodule:: fynance.models.neural_network 5 | 6 | .. autoclass:: MultiLayerPerceptron 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | MultiLayerPerceptron.__call__ 17 | MultiLayerPerceptron.add_module 18 | MultiLayerPerceptron.apply 19 | MultiLayerPerceptron.buffers 20 | MultiLayerPerceptron.children 21 | MultiLayerPerceptron.cpu 22 | MultiLayerPerceptron.cuda 23 | MultiLayerPerceptron.double 24 | MultiLayerPerceptron.eval 25 | MultiLayerPerceptron.extra_repr 26 | MultiLayerPerceptron.float 27 | MultiLayerPerceptron.forward 28 | MultiLayerPerceptron.half 29 | MultiLayerPerceptron.load_model 30 | MultiLayerPerceptron.load_state_dict 31 | MultiLayerPerceptron.modules 32 | MultiLayerPerceptron.named_buffers 33 | MultiLayerPerceptron.named_children 34 | MultiLayerPerceptron.named_modules 35 | MultiLayerPerceptron.named_parameters 36 | MultiLayerPerceptron.parameters 37 | MultiLayerPerceptron.predict 38 | MultiLayerPerceptron.register_backward_hook 39 | MultiLayerPerceptron.register_buffer 40 | MultiLayerPerceptron.register_forward_hook 41 | MultiLayerPerceptron.register_forward_pre_hook 42 | MultiLayerPerceptron.register_parameter 43 | MultiLayerPerceptron.save_model 44 | MultiLayerPerceptron.set_data 45 | MultiLayerPerceptron.set_lr_scheduler 46 | MultiLayerPerceptron.set_optimizer 47 | MultiLayerPerceptron.set_seed 48 | MultiLayerPerceptron.share_memory 49 | MultiLayerPerceptron.state_dict 50 | MultiLayerPerceptron.to 51 | MultiLayerPerceptron.train 52 | MultiLayerPerceptron.train_on 53 | MultiLayerPerceptron.type 54 | MultiLayerPerceptron.zero_grad 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.LongShortTermMemory.rst: -------------------------------------------------------------------------------- 1 | fynance.models.recurrent_neural_network.LongShortTermMemory 2 | =========================================================== 3 | 4 | .. currentmodule:: fynance.models.recurrent_neural_network 5 | 6 | .. autoclass:: LongShortTermMemory 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | LongShortTermMemory.__call__ 17 | LongShortTermMemory.add_module 18 | LongShortTermMemory.apply 19 | LongShortTermMemory.buffers 20 | LongShortTermMemory.children 21 | LongShortTermMemory.cpu 22 | LongShortTermMemory.cuda 23 | LongShortTermMemory.double 24 | LongShortTermMemory.eval 25 | LongShortTermMemory.extra_repr 26 | LongShortTermMemory.float 27 | LongShortTermMemory.forward 28 | LongShortTermMemory.half 29 | LongShortTermMemory.load_model 30 | LongShortTermMemory.load_state_dict 31 | LongShortTermMemory.modules 32 | LongShortTermMemory.named_buffers 33 | LongShortTermMemory.named_children 34 | LongShortTermMemory.named_modules 35 | LongShortTermMemory.named_parameters 36 | LongShortTermMemory.parameters 37 | LongShortTermMemory.predict 38 | LongShortTermMemory.register_backward_hook 39 | LongShortTermMemory.register_buffer 40 | LongShortTermMemory.register_forward_hook 41 | LongShortTermMemory.register_forward_pre_hook 42 | LongShortTermMemory.register_parameter 43 | LongShortTermMemory.save_model 44 | LongShortTermMemory.set_data 45 | LongShortTermMemory.set_lr_scheduler 46 | LongShortTermMemory.set_optimizer 47 | LongShortTermMemory.set_seed 48 | LongShortTermMemory.share_memory 49 | LongShortTermMemory.state_dict 50 | LongShortTermMemory.to 51 | LongShortTermMemory.train 52 | LongShortTermMemory.train_on 53 | LongShortTermMemory.type 54 | LongShortTermMemory.zero_grad 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.recurrent_neural_network.RecurrentNeuralNetwork.rst: -------------------------------------------------------------------------------- 1 | fynance.models.recurrent_neural_network.RecurrentNeuralNetwork 2 | ============================================================== 3 | 4 | .. currentmodule:: fynance.models.recurrent_neural_network 5 | 6 | .. autoclass:: RecurrentNeuralNetwork 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RecurrentNeuralNetwork.__call__ 17 | RecurrentNeuralNetwork.add_module 18 | RecurrentNeuralNetwork.apply 19 | RecurrentNeuralNetwork.buffers 20 | RecurrentNeuralNetwork.children 21 | RecurrentNeuralNetwork.cpu 22 | RecurrentNeuralNetwork.cuda 23 | RecurrentNeuralNetwork.double 24 | RecurrentNeuralNetwork.eval 25 | RecurrentNeuralNetwork.extra_repr 26 | RecurrentNeuralNetwork.float 27 | RecurrentNeuralNetwork.forward 28 | RecurrentNeuralNetwork.half 29 | RecurrentNeuralNetwork.load_model 30 | RecurrentNeuralNetwork.load_state_dict 31 | RecurrentNeuralNetwork.modules 32 | RecurrentNeuralNetwork.named_buffers 33 | RecurrentNeuralNetwork.named_children 34 | RecurrentNeuralNetwork.named_modules 35 | RecurrentNeuralNetwork.named_parameters 36 | RecurrentNeuralNetwork.parameters 37 | RecurrentNeuralNetwork.predict 38 | RecurrentNeuralNetwork.register_backward_hook 39 | RecurrentNeuralNetwork.register_buffer 40 | RecurrentNeuralNetwork.register_forward_hook 41 | RecurrentNeuralNetwork.register_forward_pre_hook 42 | RecurrentNeuralNetwork.register_parameter 43 | RecurrentNeuralNetwork.save_model 44 | RecurrentNeuralNetwork.set_data 45 | RecurrentNeuralNetwork.set_lr_scheduler 46 | RecurrentNeuralNetwork.set_optimizer 47 | RecurrentNeuralNetwork.set_seed 48 | RecurrentNeuralNetwork.share_memory 49 | RecurrentNeuralNetwork.state_dict 50 | RecurrentNeuralNetwork.to 51 | RecurrentNeuralNetwork.train 52 | RecurrentNeuralNetwork.train_on 53 | RecurrentNeuralNetwork.type 54 | RecurrentNeuralNetwork.zero_grad 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /fynance/models/xgb.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2019-04-23 19:15:05 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2019-09-25 14:14:47 8 | 9 | # Built-in packages 10 | 11 | # Third party packages 12 | # import xgboost as xgb 13 | 14 | # Local packages 15 | 16 | 17 | __all__ = ['XGB', 'XGBData'] 18 | 19 | 20 | class XGB: 21 | # TODO : train method, predict method 22 | def __init__(self, X, y, **kwargs): 23 | """ Setting data to XGBoot model. 24 | 25 | Parameters 26 | ---------- 27 | X, y : np.ndarray[ndim=2, dtype=np.float64] 28 | Respectively features with shape `(T, N)` and target with shape 29 | `(T, 1)` of the model. 30 | kwargs : dict, optional 31 | Parameters of DMatrix object, cf XGBoost documentation [1]_. 32 | 33 | References 34 | ---------- 35 | .. [1] https://xgboost.readthedocs.io/en/latest/python/python_api.html 36 | 37 | """ 38 | self.data = XGBData(X, label=y, **kwargs) 39 | 40 | def run(self, n, s, **params): 41 | # TODO : to remove 42 | train = self.data[:-n] 43 | estim = self.data[: s] 44 | # bst = xgb.train(params, train) 45 | # return bst.predict(estim) 46 | 47 | 48 | class XGBData: # (xgb.DMatrix): 49 | """ Set data for XGBoost models. """ 50 | 51 | def __getitem__(self, key): 52 | """ Slice the DMatrix and return a new DMatrix that only contains `key`. 53 | 54 | Parameters 55 | ---------- 56 | key : slice 57 | Slice to be selected. 58 | 59 | Returns 60 | ------- 61 | res : DMatrix 62 | A new DMatrix containing only selected indices. 63 | 64 | """ 65 | start = 0 if key.start is None else key.start 66 | step = 1 if key.step is None else key.step 67 | stop = self.num_row() if key.stop is None else key.stop 68 | 69 | if step < 0: 70 | stop, start = start - 1, stop + 1 71 | 72 | if stop < 0: 73 | stop += self.num_row() + 1 74 | 75 | return self.slice(list(range(start, stop, step))) 76 | 77 | 78 | def train_xgb(params, dtrain, bst=None, **kwargs): 79 | """ Train a XGBoost model """ 80 | if bst is None: 81 | pass 82 | 83 | # return xgb.train(params, dtrain, **kwargs) 84 | 85 | else: 86 | pass 87 | 88 | # return xgb.train(params, dtrain, xgb_model=bst, **kwargs) 89 | -------------------------------------------------------------------------------- /fynance/backtest/_basis_plot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2020-10-24 09:03:49 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2020-11-20 09:09:02 8 | 9 | """ Description. """ 10 | 11 | # Built-in packages 12 | from abc import ABCMeta, abstractmethod 13 | 14 | # Third party packages 15 | # import numpy as np 16 | import matplotlib.pyplot as plt 17 | # import seaborn as sns 18 | 19 | # Local packages 20 | 21 | __all__ = [] 22 | 23 | 24 | class _BasisAxes(metaclass=ABCMeta): 25 | def __call__(self, fig, n_rows, n_cols, n_axes): 26 | self.fig = fig 27 | self.n_axes = n_axes 28 | self.ax = self.fig.add_subplot(n_rows, n_cols, n_axes) 29 | 30 | # @abstractmethod 31 | def plot(self, y, x=None): 32 | if x is None: 33 | self.ax.plot(y) 34 | 35 | else: 36 | self.ax.plot(x, y) 37 | 38 | 39 | class _BasisPlot: 40 | def __init__(self, **kwargs): 41 | self.fig = plt.figure(**kwargs) 42 | self._n_axes = 0 43 | self._n_cols = 1 44 | self._n_rows = 0 45 | self.axes = {} 46 | self.keys = [] 47 | 48 | def __setitem__(self, key, value: _BasisAxes): 49 | # Set optimal number of axes on figure plot 50 | self._n_axes += 1 51 | sqrt_n_axes = self._n_axes ** 0.5 52 | if self._n_cols * self._n_rows < self._n_axes: 53 | if self._n_rows > self._n_cols and self._n_rows >= sqrt_n_axes: 54 | self._n_cols += 1 55 | 56 | else: 57 | self._n_rows += 1 58 | 59 | print(self._n_rows, self._n_cols) 60 | self.axes[key] = value 61 | self.keys.append(key) 62 | 63 | def __delitem__(self, key): 64 | # Set optimal number of axes on figure plot 65 | self._n_axes -= 1 66 | n_cols = self._n_cols 67 | n_rows = self._n_rows 68 | if (n_cols - 1) * n_rows >= self._n_axes: 69 | self._n_cols -= 1 70 | 71 | elif (n_rows - 1) * n_cols >= self._n_axes: 72 | self._n_rows -= 1 73 | 74 | if self._n_axes < 1: 75 | self.fig = None 76 | print("destruct fig") 77 | 78 | del self.axes[key] 79 | self.keys.remove(key) 80 | 81 | def __getitem__(self, key): 82 | return self.axes[key] 83 | 84 | def set_axes(self): 85 | for i, key in enumerate(self.keys, 1): 86 | self.axes[key](self.fig, self._n_rows, self._n_cols, i) 87 | 88 | return self 89 | 90 | 91 | if __name__ == "__main__": 92 | pass 93 | -------------------------------------------------------------------------------- /doc/source/generated/fynance.models.rolling.RollMultiLayerPerceptron.rst: -------------------------------------------------------------------------------- 1 | fynance.models.rolling.RollMultiLayerPerceptron 2 | =============================================== 3 | 4 | .. currentmodule:: fynance.models.rolling 5 | 6 | .. autoclass:: RollMultiLayerPerceptron 7 | :no-members: 8 | :no-inherited-members: 9 | :no-special-members: 10 | 11 | 12 | .. HACK -- the point here is that we don't want this to appear in the output, but the autosummary should still generate the pages. 13 | .. autosummary:: 14 | :toctree: 15 | 16 | RollMultiLayerPerceptron.__call__ 17 | RollMultiLayerPerceptron.add_module 18 | RollMultiLayerPerceptron.apply 19 | RollMultiLayerPerceptron.buffers 20 | RollMultiLayerPerceptron.children 21 | RollMultiLayerPerceptron.cpu 22 | RollMultiLayerPerceptron.cuda 23 | RollMultiLayerPerceptron.double 24 | RollMultiLayerPerceptron.eval 25 | RollMultiLayerPerceptron.extra_repr 26 | RollMultiLayerPerceptron.float 27 | RollMultiLayerPerceptron.forward 28 | RollMultiLayerPerceptron.half 29 | RollMultiLayerPerceptron.load_model 30 | RollMultiLayerPerceptron.load_state_dict 31 | RollMultiLayerPerceptron.modules 32 | RollMultiLayerPerceptron.named_buffers 33 | RollMultiLayerPerceptron.named_children 34 | RollMultiLayerPerceptron.named_modules 35 | RollMultiLayerPerceptron.named_parameters 36 | RollMultiLayerPerceptron.parameters 37 | RollMultiLayerPerceptron.pre_run 38 | RollMultiLayerPerceptron.predict 39 | RollMultiLayerPerceptron.register_backward_hook 40 | RollMultiLayerPerceptron.register_buffer 41 | RollMultiLayerPerceptron.register_forward_hook 42 | RollMultiLayerPerceptron.register_forward_pre_hook 43 | RollMultiLayerPerceptron.register_parameter 44 | RollMultiLayerPerceptron.run 45 | RollMultiLayerPerceptron.save 46 | RollMultiLayerPerceptron.save_model 47 | RollMultiLayerPerceptron.set_data 48 | RollMultiLayerPerceptron.set_lr_scheduler 49 | RollMultiLayerPerceptron.set_optimizer 50 | RollMultiLayerPerceptron.set_roll_period 51 | RollMultiLayerPerceptron.set_seed 52 | RollMultiLayerPerceptron.share_memory 53 | RollMultiLayerPerceptron.state_dict 54 | RollMultiLayerPerceptron.sub_predict 55 | RollMultiLayerPerceptron.to 56 | RollMultiLayerPerceptron.train 57 | RollMultiLayerPerceptron.train_on 58 | RollMultiLayerPerceptron.type 59 | RollMultiLayerPerceptron.zero_grad 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /fynance/models/attention.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # coding: utf-8 3 | # @Author: ArthurBernard 4 | # @Email: arthur.bernard.92@gmail.com 5 | # @Date: 2023-07-27 09:10:43 6 | # @Last modified by: ArthurBernard 7 | # @Last modified time: 2023-08-02 12:26:48 8 | 9 | """ Neural network with attention model. """ 10 | 11 | # Built-in packages 12 | 13 | # Third party packages 14 | import torch 15 | from torch import nn 16 | # from torch.nn import functional as F 17 | 18 | # Local packages 19 | from fynance.models.neural_network import BaseNeuralNet 20 | 21 | __all__ = [] 22 | 23 | 24 | class _BaseAttention(BaseNeuralNet): 25 | 26 | pass 27 | 28 | 29 | class ScaledDotProductAttention(_BaseAttention): 30 | r""" Scaled Dot-Product Attention model. 31 | 32 | Attention model described in the paper "Attention is All You Need". 33 | 34 | .. math:: A(Q, K, V) = softmax(\frac{QK^T}{\sqrt{d_k}})V 35 | 36 | Parameters 37 | ---------- 38 | n_q, n_k : int 39 | Respectively lenght of the queries and keys (and values). 40 | d_k, d_v : int 41 | Respectively dimension of the keys (and queries) and values. 42 | 43 | Methods 44 | ------- 45 | __call__ 46 | 47 | Attribute 48 | --------- 49 | w_q, w_k, w_v : torch.nn.Linear 50 | Respectively queries, keys and values weights. 51 | softmax : torch.nn.Softmax 52 | Softmax activation function. 53 | 54 | References 55 | ---------- 56 | "Attention is All You Need" (Ashish Vaswani, Noam Shazeer, Niki Parmar, 57 | Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, Illia 58 | Polosukhin, arxiv, 2017). 59 | 60 | """ 61 | 62 | def __init__(self, n_q, n_k, d_k, d_v): 63 | 64 | self.w_q = nn.Linear(n_q, d_k, bias=False) 65 | self.w_k = nn.Linear(n_k, d_k, bias=False) 66 | self.w_v = nn.Linear(n_k, d_v, bias=False) 67 | 68 | self.softmax = nn.Softmax(dim=-1) 69 | 70 | def forward(self, q, k, v, mask=None): 71 | """ Forward method. 72 | 73 | Parameters 74 | ---------- 75 | q, k, v : torch.Tensor 76 | Queries, keys and values input data, respectively of shape (n_q, 77 | d_k), (n_k, d_k) and (n_k, d_v). 78 | 79 | Returns 80 | ------- 81 | torch.Tensor 82 | Output of the attention model of shape (n_q, d_v). 83 | torch.Tensor 84 | Attention residual (?) of shape (n_q, n_k). # FIXME 85 | 86 | """ 87 | q = self.w_q(q) 88 | k = self.w_k(k) 89 | v = self.w_v(v) 90 | 91 | attn = self.dropout(self.softmax(q / q.size(1) ** 0.5 @ k.T)) 92 | output = attn @ v 93 | 94 | return output, attn 95 | 96 | 97 | class SelfAttention(ScaledDotProductAttention): 98 | 99 | def forward(self, x, mask=None): 100 | return super().forward(q=x, k=x, v=x, mask=mask) 101 | 102 | 103 | if __name__ == "__main__": 104 | pass 105 | --------------------------------------------------------------------------------