Skip to content

Commit

Permalink
Move to Torch (#7)
Browse files Browse the repository at this point in the history
* move to torch

* remove pycharm folder

* remove pycharm folder try 2

* remove pycharm folder try 3

* Update README.md

* try travis matrix with python
  • Loading branch information
vankesteren authored Jun 2, 2020
1 parent 4819a0d commit 84f2dda
Show file tree
Hide file tree
Showing 38 changed files with 1,149 additions and 949 deletions.
19 changes: 17 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
^LICENSE\.md$
^README\.md$
^\.travis.yml$

# dirs
^img$
^bin$
^tensorsem$
^tensorsem\.egg-info$
^example$

# python files
^\.idea/.*$
^__pycache__$
^setup.py$
^venv$

# R files
^.*\.Rproj$
^\.Rproj\.user$
^img.*$
^\.travis\.yml$
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
129 changes: 126 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,127 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/
.Rproj.user
.Rhistory
.RData
.Ruserdata
.idea/
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
language: r
cache:
- packages
- $HOME/.cache/pip
latex: false
before_install:
- R -e 'install.packages("devtools")'
- R -e 'devtools::install_github("rstudio/tensorflow")'
- R -e 'tensorflow::install_tensorflow(version = "2.1.0")' > tf_install_log.txt
matrix:
include:
- os: linux
- language: r
latex: false
os: linux
r: release
- os: linux
- language: r
latex: false
os: linux
r: devel
- language: python
python: "3.6"
install:
- pip install torch==1.5.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
- pip install pandas matplotlib
- pip install .
script: python example/tensorsem_example.py
19 changes: 6 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
Package: tensorsem
Type: Package
Title: Structural Equation Models using TensorFlow
Version: 0.1.2
Title: Estimate structural equation models using computation graphs
Version: 1.0.0
Author: Erik-Jan van Kesteren
Maintainer: Erik-Jan van Kesteren <[email protected]>
Description: Perform Structural Equation Modeling using a TensorFlow
session.
Description: Use lavaan code to create structural equation models, use torch to estimate them.
This package provides the interface between lavaan and python.
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.0.2
Imports:
tensorflow,
reticulate,
lavaan,
R6,
progress,
stringr,
methods
Suggests:
testthat
lavaan
RoxygenNote: 7.1.0
4 changes: 2 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ and each file should have at least the “copyright” line and a pointer to
where the full notice is found.

<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 2019 Erik-Jan van Kesteren
Copyright (C) 2020 Erik-Jan van Kesteren

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -573,7 +573,7 @@ Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this
when it starts in an interactive mode:

tensorsem Copyright (C) 2019 Erik-Jan van Kesteren
lavtorch Copyright (C) 2020 Erik-Jan van Kesteren
This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type 'show c' for details.
Expand Down
14 changes: 4 additions & 10 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(tf_sem)
importFrom(R6,R6Class)
importFrom(methods,new)
importFrom(progress,progress_bar)
importFrom(stats,cov)
importFrom(stringr,str_pad)
importFrom(stringr,str_trim)
importFrom(tensorflow,shape)
importFrom(tensorflow,tf)
importFrom(utils,getFromNamespace)
export(lav_mod_to_torch_opts)
export(partable_from_torch)
export(syntax_to_torch_opts)
export(torch_opts_to_file)
Loading

0 comments on commit 84f2dda

Please sign in to comment.