Skip to content

Instantly share code, notes, and snippets.

View chen0040's full-sized avatar

Xianshun Chen chen0040

View GitHub Profile
@chen0040
chen0040 / Install PyTorch on Windows and PyCharm
Created April 14, 2018 13:34
Share my approach to get PyTorch install on Windows and Make it available to PyCharm
Install anaconda and run the following command (with admin permission on windows os):
```bash
conda install -c peterjc123 pytorch
```
at this point, torch is available in your global site packages.
If you use PyCharm as the IDE, you can create a virtual-env and select "Inherit global site packages".
getBinaryObjById(id: number, token: string) {
const req = {
token: string
};
Observable.create(observer => {
let xhr = new XMLHttpRequest();
xhr.open('POST', './erp/binary-obj/find-binary-obj-by-id?id=' + id, true);
xhr.setRequestHeader('Content-type', 'application/json');
xhr.responseType='blob';
xhr.onreadystatechange = function () {
@chen0040
chen0040 / Cifar10ImageClassifier.java
Created March 1, 2018 04:35
Java tensorflow that loads the cnn_cifar10.pb (available in my github keras-image-classifier-web-api) and uses it to predict label of images store in the resource folder images/cifar10
package com.github.chen0040.tflite.hello;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.tensorflow.Graph;
import org.tensorflow.Operation;
import org.tensorflow.Session;
import org.tensorflow.Tensor;
import javax.imageio.ImageIO;
#!/usr/bin/env bash
bin=`dirname "${BASH_SOURCE-$0}"`
pwd=`pwd`
startup_dir=$pwd/$bin
echo $startup_dir
<licenses>
<license>
<name>MIT</name>
<url>https://github.com/chen0040/java-glm/LICENSE.md</url>
<comments>MIT License</comments>
</license>
</licenses>
<developers>
<developer>
<profile>
<id>release</id>
<properties>
<current.scope>compile</current.scope>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
language: java
jdk: oraclejdk8
cache:
directories:
- $HOME/.m2
before_install:
- chmod +x mvnw
import re
import ast
import io
_version_re = re.compile(r'__version__\s+=\s+(.*)')
package_name = 'pyalgs'
with open(package_name + '/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
language: python
python:
- "2.7"
- "3.3"
- "3.4"
- "3.5"
- "pypy"
- "pypy3"