test2
This commit is contained in:
parent
8b4b2a5232
commit
9fdfb598ae
@ -2,7 +2,7 @@
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.7" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.6" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
|
4
.idea/encodings.xml
Normal file
4
.idea/encodings.xml
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6" project-jdk-type="Python SDK" />
|
||||
</project>
|
@ -1,13 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="d25a65da-2ba0-4272-a0a5-c59cbecb6088" name="Default Changelist" comment="" />
|
||||
<list default="true" id="d25a65da-2ba0-4272-a0a5-c59cbecb6088" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/TAU_21_sane_words.iml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/TAU_21_sane_words.iml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dev-0/out.tsv" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/dev-0/out_float.tsv" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/s.py" beforeDir="false" afterPath="$PROJECT_DIR$/s.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-A/out.tsv" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/test-A/out_float.tsv" beforeDir="false" />
|
||||
</list>
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="CoverageDataManager">
|
||||
<SUITE FILE_PATH="coverage/TAU_22_sane_words_torch_nn$s.coverage" NAME="s Coverage Results" MODIFIED="1575397648319" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf SIDE_TABS_SIZE_LIMIT_KEY="375">
|
||||
<file pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/s.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="64">
|
||||
<caret line="181" column="30" selection-start-line="181" selection-start-column="30" selection-end-line="181" selection-end-column="30" />
|
||||
<folding>
|
||||
<element signature="e#0#12#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FileTemplateManagerImpl">
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
@ -18,9 +46,52 @@
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/s.py" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="118" />
|
||||
<option name="y" value="28" />
|
||||
<option name="width" value="1293" />
|
||||
<option name="height" value="697" />
|
||||
</component>
|
||||
<component name="ProjectId" id="1UAXhosCPbReL7U2TCbyyTVGpqs" />
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
|
||||
<component name="ProjectView">
|
||||
<navigator proportions="" version="1">
|
||||
<foldersAlwaysOnTop value="true" />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="Scope" />
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<expand>
|
||||
<path>
|
||||
<item name="TAU_22_sane_words_torch_nn" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="TAU_22_sane_words_torch_nn" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="TAU_22_sane_words_torch_nn" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="TAU_22_sane_words_torch_nn" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="dev-0" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
<path>
|
||||
<item name="TAU_22_sane_words_torch_nn" type="b2602c69:ProjectViewProjectNode" />
|
||||
<item name="TAU_22_sane_words_torch_nn" type="462c0819:PsiDirectoryNode" />
|
||||
<item name="test-A" type="462c0819:PsiDirectoryNode" />
|
||||
</path>
|
||||
</expand>
|
||||
<select />
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
|
||||
<property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
|
||||
</component>
|
||||
@ -49,6 +120,7 @@
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/s.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
@ -70,6 +142,7 @@
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/solution.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
@ -91,6 +164,7 @@
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/solution2.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
@ -118,15 +192,70 @@
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1574800494334</updated>
|
||||
<workItem from="1575295202536" duration="3102000" />
|
||||
<workItem from="1575395694316" duration="2555000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TimeTrackingManager">
|
||||
<option name="totallyTimeSpent" value="5657000" />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="118" y="28" width="1293" height="697" extended-state="0" />
|
||||
<layout>
|
||||
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.23481782" />
|
||||
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
|
||||
<window_info id="Favorites" order="2" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Message" order="0" />
|
||||
<window_info anchor="bottom" id="Find" order="1" />
|
||||
<window_info anchor="bottom" id="Run" order="2" visible="true" weight="0.29963234" />
|
||||
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
|
||||
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
|
||||
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
|
||||
<window_info anchor="bottom" id="TODO" order="6" />
|
||||
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
|
||||
<window_info anchor="bottom" id="Version Control" order="8" />
|
||||
<window_info anchor="bottom" id="Database Changes" order="9" />
|
||||
<window_info anchor="bottom" id="Event Log" order="10" side_tool="true" />
|
||||
<window_info anchor="bottom" id="Terminal" order="11" />
|
||||
<window_info anchor="bottom" id="Python Console" order="12" />
|
||||
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
|
||||
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
|
||||
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
|
||||
<window_info anchor="right" id="SciView" order="3" />
|
||||
<window_info anchor="right" id="Database" order="4" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="1" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
<State>
|
||||
<option name="RECENTLY_FILTERED_USER_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
</State>
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
<option name="RECENT_FILTERS">
|
||||
<map>
|
||||
<entry key="Branch">
|
||||
<value>
|
||||
<list />
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="User">
|
||||
<value>
|
||||
<list />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
@ -140,4 +269,39 @@
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/test-A/out_float.tsv">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/test-A/out.tsv">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dev-0/out.tsv">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="108">
|
||||
<caret line="6" lean-forward="true" selection-start-line="6" selection-end-line="6" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dev-0/expected.tsv">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="202">
|
||||
<caret line="11026" lean-forward="true" selection-start-line="11026" selection-end-line="11026" />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dev-0/out_float.tsv">
|
||||
<provider selected="true" editor-type-id="text-editor" />
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/s.py">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state relative-caret-position="64">
|
||||
<caret line="181" column="30" selection-start-line="181" selection-start-column="30" selection-end-line="181" selection-end-column="30" />
|
||||
<folding>
|
||||
<element signature="e#0#12#0" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
22052
dev-0/out_float.tsv
22052
dev-0/out_float.tsv
File diff suppressed because it is too large
Load Diff
2
results.txt
Normal file
2
results.txt
Normal file
@ -0,0 +1,2 @@
|
||||
loss = 0.0010254832450300455
|
||||
f1: 0.963087248322
|
53
s.py
53
s.py
@ -16,7 +16,7 @@ model = nn.Sequential(
|
||||
nn.Linear(16,1),
|
||||
nn.Sigmoid())
|
||||
criterion = nn.MSELoss()
|
||||
optimizer = optim.SGD(model.parameters(), lr=0.000001, momentum=0.8)
|
||||
optimizer = optim.SGD(model.parameters(), lr=0.001, momentum=0.9)
|
||||
#optimizer = optim.Adam(model.parameters())
|
||||
|
||||
|
||||
@ -132,27 +132,27 @@ testA_x = torch.cat([testA_x_temp.transpose(1,0), testA_x3], 1)
|
||||
dataset_train = TrainDataset(x, y)
|
||||
trainloader=DataLoader(dataset=dataset_train,batch_size=5)
|
||||
|
||||
def train_loop(i = 4200): #~7h
|
||||
for i in range(i):
|
||||
for xb, yb_expected in trainloader: # for each iteration a bach of samples is taken from loader(currently batch_size=5)
|
||||
yp = model(xb)
|
||||
for i in range(2):
|
||||
for xb, yb_expected in trainloader: # for each iteration a bach of samples is taken from loader(currently batch_size=5)
|
||||
yp = model(xb)
|
||||
|
||||
# debug
|
||||
"""
|
||||
debug_xb = pandas.DataFrame(xb.numpy())
|
||||
debug_yb_expected = pandas.DataFrame(yb_expected.numpy())
|
||||
debug_yp = pandas.DataFrame(yp.detach().numpy())
|
||||
"""
|
||||
|
||||
loss = criterion(yp, yb_expected)
|
||||
optimizer.zero_grad()
|
||||
loss.backward()
|
||||
optimizer.step()
|
||||
print(loss)
|
||||
# debug
|
||||
"""
|
||||
debug_xb = pandas.DataFrame(xb.numpy())
|
||||
debug_yb_expected = pandas.DataFrame(yb_expected.numpy())
|
||||
debug_yp = pandas.DataFrame(yp.detach().numpy())
|
||||
"""
|
||||
#print(torch.squeeze(yp))
|
||||
#print(yb_expected)
|
||||
loss = criterion(torch.squeeze(yp), yb_expected)
|
||||
optimizer.zero_grad()
|
||||
loss.backward()
|
||||
optimizer.step()
|
||||
#print(loss)
|
||||
|
||||
#4 200
|
||||
elapsed_time = timeit.timeit(train_loop, number=1)
|
||||
print("Training time: ", elapsed_time, "seconds")
|
||||
#elapsed_time = timeit.timeit(train_loop, number=1)
|
||||
#print("Training time: ", elapsed_time, "seconds")
|
||||
|
||||
#saving results:
|
||||
#dev0:
|
||||
@ -179,14 +179,21 @@ print("f1_score_dev0 after training: ", score,"\nAcc: ", accuracy_score(dev_y_te
|
||||
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
#testA:
|
||||
testA_y = model(testA_x)
|
||||
file=open("test-A/out.tsv","w")
|
||||
file=open("test-A/out.tsv","w+")
|
||||
file2=open("test-A/out_float.tsv","w")
|
||||
|
||||
for i in range(0,11061):
|
||||
file2.write(str(testA_y[i].data.item()) + "\n")
|
||||
if testA_y[i].data.item() < 0.5:
|
||||
file.write("0" + "\n")
|
||||
file.write("0\n")
|
||||
else:
|
||||
file.write("1" + "\n")
|
||||
file.write("1\n")
|
||||
file.close()
|
||||
file2.close()
|
||||
file2.close()
|
||||
|
||||
|
||||
|
||||
file=open("results.txt","w")
|
||||
file.write("loss = " + str(loss.item())+ "\n")
|
||||
file.write("f1: " + str(score) + "\n" )
|
||||
file.close()
|
11026
test-A/expected.tsv
Normal file
11026
test-A/expected.tsv
Normal file
File diff suppressed because it is too large
Load Diff
22122
test-A/out.tsv
22122
test-A/out.tsv
File diff suppressed because it is too large
Load Diff
11061
test-A/out_float.tsv
11061
test-A/out_float.tsv
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user