This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"class" : "HiddenMarkovModel", | |
"name" : "LabelTrainedJaveTokenHMM", | |
"start" : { | |
"class" : "State", | |
"distribution" : null, | |
"name" : "LabelTrainedJaveTokenHMM-start", | |
"weight" : 1.0 | |
}, | |
"end" : { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from model.hmm_pom import Trained10StateHMM, Trained100StateHMM | |
from model.ngram import KenLM10Gram | |
from analyze.parser import SourceCodeParser | |
TEST_SRC = """ | |
public class HelloWorld { | |
public static void main(String[] args) { | |
System.out.println("Hello, world!"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./insyn.py --test-atn-hmm-model expMultinomialHMM(algorithm='viterbi', init_params='ste', n_components=1133, | |
n_iter=10, params='ste', random_state=None, | |
startprob_prior=array([1., 0., ..., 0., 0.]), tol=0.01, | |
transmat_prior=array([[0., 1., ..., 0., 0.], | |
[0., 0., ..., 0., 0.], | |
..., | |
[0., 0., ..., 0., 0.], | |
[0., 0., ..., 0., 0.]]), | |
verbose=True) | |
idx: 1/44 score: -2.639058036757866 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./insyn.py --log info --test-ngram-model example/HelloWorld.java | |
Loading the LM will be faster if you build a binary file. | |
Reading /home/alexander/sandbox/src/github.com/awwong1/cmput563_insyn/model/java-tokenstr-10grams.arpa | |
----5---10---15---20---25---30---35---40---45---50---55---60---65---70---75---80---85---90---95--100 | |
**************************************************************************************************** | |
PUBLIC CLASS IDENTIFIER LBRACE PUBLIC STATIC VOID IDENTIFIER LPAREN IDENTIFIER LBRACKET RBRACKET IDENTIFIER RPAREN LBRACE IF LPAREN TRUE RPAREN LBRACE IDENTIFIER DOT IDENTIFIER DOT IDENTIFIER LPAREN STRINGLITERAL RPAREN SEMI RBRACE RBRACE RBRACE EOF | |
example/HelloWorld.java: MOD from LBRACE to INTLITERAL at 3 | |
INFO:analyze.ngram_tester:suggest MOD INTLITERAL into LBRACE at 3 (score: -12.189971923828125) | |
INFO:analyze.ngram_tester:suggest DEL INTLITERAL at 3 (score: -21.153898239135742) | |
INFO:analyze.ngram_tester:suggest MOD INTLITERAL into LPAREN at 3 (score: -21.760189056396484) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./model/HHMM.py | |
./model/HHMM.py:111: RuntimeWarning: invalid value encountered in true_divide | |
PI[col, row, :] = np.nan_to_num(PI[col, row, :] / np.sum(PI[col, row, :])) | |
./model/HHMM.py:110: RuntimeWarning: invalid value encountered in true_divide | |
A[col, row, :] = np.nan_to_num(A[col, row, :] / np.sum(A[col, row, :])) | |
Training iteration 0 | |
./model/HHMM.py:157: RuntimeWarning: invalid value encountered in true_divide | |
ergPIVis[col, row, :] = np.nan_to_num(ergPI[col, row, :] / np.sum(ergPI[col, row, :])) | |
./model/HHMM.py:156: RuntimeWarning: invalid value encountered in true_divide | |
ergAVis[col, row, :] = np.nan_to_num(ergA[col, row, :] / np.sum(ergA[col, row, :])) |

This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./insyn.py --parse-example --db-offset 0 | |
============== SOURCE CODE ============== | |
package com.cl.interpolatordebugger; | |
import android.app.Application; | |
import android.test.ApplicationTestCase; | |
/** | |
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
q(:,:,1) = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; | |
1 1 1 1 1 1 1 2 0 0 0 0 0 0 0 0 0; | |
1 1 1 1 2 1 1 1 1 1 1 2 1 1 1 1 2; | |
1 1 2 1 1 1 1 1 1 2 1 1 1 1 2 0 0]; | |
q(:,:,2) = [8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0; | |
0 5 0 7 0 0 5 0 0 0 0 0 0 0 0 0 0; | |
0 0 0 3 0 7 0 0 0 0 0 5 0 0 0 0 0; | |
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]; | |
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |