Giter Site home page Giter Site logo

abrahamnunes / fitr Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 2.0 5.16 MB

Tools for computational psychiatry research.

Home Page: https://computationalpsychiatry.github.io/fitr

License: GNU General Public License v3.0

Python 99.38% Shell 0.07% Stan 0.55%
computational-neuroscience computational-psychiatry

fitr's Introduction

Fitr is currently being rewritten from the ground up to be faster and more flexible. Stay tuned for updates.

Getting Started

Prerequisites

conda install --yes --file requirements.txt

or

pip install -r requirements.txt

Installation

pip install git+https://github.com/abrahamnunes/fitr.git

or

git clone https://github.com/abrahamnunes/fitr.git
cd fitr
python setup.py develop --user

Running Tests

conda install --yes --file requirements_test.txt

or

pip install -r requirements_test.txt

Documentation

  • Full API documentation in the docs/api folder.
  • Detailed documentation in docs/tex/fitr_documentation.pdf

Examples

  • See examples/ folder
  • Tutorials with deeper explanations in docs/tex/fitr_documentation.pdf

Contributing

  • Being Updated

License

  • This project uses the GNU General Public License v3.0 - see the LICENSE.md file for details

How to Cite

If you use Fitr in your work, we would very much appreciate the citation, which can be done as follows:

fitr's People

Contributors

abrahamnunes avatar arudiuk avatar pyup-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fitr's Issues

Package for PyPI

We need to be able to install this using pip as a proper package. In it's current form, it is more like a Matlab toolbox...

Removing Old Branches

I think the following branches can be safely removed
abrahamnunes-path-1
docs
param_criticism
readmechange

And i'm not sure what the following two are for:
pyup-initial-update
gh-pages

Thoughts @abrahamnunes ?

Remove old requirements

I believe the file requirements_docs is for the old documentation, which should be removed.

Iteration Plan for 0.0.2

This plan captures the work that needs to be done before 0.0.2 of the package gets released.
The planned release date for this is late July.

This iteration will involve a complete re-work of the overall structure of fitr, along with a change in what tools will be provided, and where future work will be focused. This change is being made to reflect a more modular nature that is going to be taken with fitr. This means less off a focus on providing pre-made models, and rather providing more tools to build, visualize, fit, and test models.

Once this issue is closed then issue #66 will be used for final release.

Plan Items

I am following a similar structure to vscode. Below is a summary of the top level plan items.

Legend of annotations

Mark Description
πŸƒ work in progress
βœ‹ blocked task
πŸ’ͺ stretch goal for this iteration
πŸ”΄ missing issue reference
πŸ”΅ more investigation required to remove uncertainty
⚫️ under discussion within the team

fitr structure

  • Replace fitr code #69
  • Update README #68
    • Remove Unused Tags #68
    • Change to standardized open source template #68
    • Update to markdown from rst #68 #70
  • Remove what's_new.rst #70
  • Update CONTRIBUTING #76
    • Change to standardized open source template #76
  • Check LICENSE #77
  • Clear old issues or re-word #10 #11 #32 #34 #60
  • Potentially remove _config.yml
  • Update requirements.txt
  • Potentially remove requirements_docs #85
  • Investigate purpose of requirements_test
  • Remove old branches #72

pypi Release

  • Do a pass through setup.py
  • βœ‹ Potentially remove setup.cfg if not needed anymore

Documentation

  • Remove old documentation #69
  • πŸ”΄Find new documentation method

Example

  • Remove old examples #69

Testing

  • Remove old tests #71
  • Update Travis to pass #71

Deferred Items

  • Tests for new code #67
  • πŸ”΄New examples

Changing fitr code

I think that what we should do with the master branch is to remove all the old code in one commit, and then add the new code in another. I think this will look cleaner in git.

If that sounds good I will delete everything in the fitr subfolder and then you can fill it up later?
@abrahamnunes

EmpiricalPriors BIC and AIC negative sign

Just noticed that BIC and AIC are negative when empirical priors. This is just because the sign of the loglikelihood is reversed when they are calculated.

I will fix this.

Include Stan code in separate folder

Currently, I've put the stan model code in strings within the generative_models.py file, in respective classes. When I tried to include these files in a separate folder with links in the respective class to the .stan file, this was throwing errors.

I think it would be better to enable the package to include .stan files on their own, rather than restricting their inclusion to strings.

Tests for New Code

Once the new code is in this issue will be used to discuss the development of tests.

This issue closes #10

Moving to Python 3

I'm going to drop support for Python 2 in the next merge, and move to exclusive development in Python 3. Pretty much all libraries that fitr uses have robust Python3 implementations, and Python2 is nearing end of life. Consequently, I think spending further time supporting python2 in fitr is suboptimal.

If there are significant concerns about this, please let me know.

MDP Agents on Bandit Tasks

It is difficult to use an MDP agent on a Bandit task, mainly because of the eligibility trace update.

On a contextual 2 armed bandit task, the final action is $\mathbf u' = (0.5, 0.5)^\top$. The 0.5's are necessary in order to facilitate computation of the target $y_t = r_t - \mathbf u'^\top \mathbf Q \mathbf x'$ such that

equation

However, the eligibility trace is updated as

equation

which in a 4 state (2 context, 2 outcome) task with $\lambda = \gamma = 1$, and where $\mathbf x = (1, 0, 0, 0)^\top$, $\mathbf u = (1, 0)^\top$ and $\mathbf x' = (0, 0, 1, 0)^\top$, should result in a trace that looks like

equation

The current setup will allow either the correct trace or the correct target calculation.

I think the solution may be to separate the trace updating function from the value function updating.

Updating tests

Since we are going to work with a new code base how do you feel about simply deleting all the current tests @abrahamnunes ?

Update Readme

The readme needs to be cleared up. I'm thinking a couple things are important for this.

  1. Change the format from rst to md
  2. Remove clutter from headers
  3. Adopt a more standardized format

Any thoughts @abrahamnunes

This should also cover the old issue #11 which should be fixed.

Remove rst and switch to md

Some files are rst, and we all prefer md. This affects the readme and whats_new files.

Should not be a hard task to switch them over to md.

Coordinate transformations and identity transform.

Create utility function in fitr.utils to apply coordinate transformations. Currently this is in the data module, but not best put there.

Also we need an identity transformation for special cases where no transformation is desired.

Add GLM into MCMC and EM

The EMFit code by Quentin Huys includes ability to have regressors incorporated in the EM procedure. I will look further at his code and incorporate this into fitr.EM().

I will also look into building this into MCMC models.

Docs not rendering

The documentation written and compiled with sphinx is not rendering correctly.

@ARudiuk could you have a look to see what might be happening?

Many of our functions are decently documented, but for whatever reason I can't get them to render in sphinx with autodoc.

0.0.2 release

Steps for releasing next version

  • Make sure issues in #65 are either complete or deferred
  • Update setup.py info
  • Build distributions
  • Upload distributions

"Duplicate citations" in documentation

I've been building documentation further on the "docs" branch.

A problem I've been running into is the generation of warnings because of duplicate citations. I've tried moving the references to the top of each module (which does end up shortening the function/class-level docstrings). However, this is somewhat ugly in the docs, from my perspective. Furthermore, there are still duplicates across modules.

Is there a way to have a global citation/reference list for the documentation, such that these warnings do not occur? I also think it would be cleaner this way.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.