Skip to content

Commit 9723d9c

Browse files
committed
updated to cntk 2.5
1 parent 295c3c2 commit 9723d9c

File tree

13 files changed

+438
-801
lines changed

13 files changed

+438
-801
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Ignore Visual Studio temporary files, build results, and
22
## files generated by popular Visual Studio add-ons.
33

4+
*/Local/*.fsx
5+
46
# User-specific files
57
*.suo
68
*.user

FsCNTK/FsCNTK.fsproj

+24-20
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,6 @@
5353
</Otherwise>
5454
</Choose>
5555
<Import Project="$(FSharpTargetsPath)" />
56-
<Import Project="..\packages\CNTK.Deps.Cuda.2.4.0\build\net45\CNTK.Deps.Cuda.targets" Condition="Exists('..\packages\CNTK.Deps.Cuda.2.4.0\build\net45\CNTK.Deps.Cuda.targets')" />
57-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
58-
<PropertyGroup>
59-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
60-
</PropertyGroup>
61-
<Error Condition="!Exists('..\packages\CNTK.Deps.Cuda.2.4.0\build\net45\CNTK.Deps.Cuda.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.Cuda.2.4.0\build\net45\CNTK.Deps.Cuda.targets'))" />
62-
<Error Condition="!Exists('..\packages\CNTK.Deps.cuDNN.2.4.0\build\net45\CNTK.Deps.cuDNN.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.cuDNN.2.4.0\build\net45\CNTK.Deps.cuDNN.targets'))" />
63-
<Error Condition="!Exists('..\packages\CNTK.Deps.MKL.2.4.0\build\net45\CNTK.Deps.MKL.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.MKL.2.4.0\build\net45\CNTK.Deps.MKL.targets'))" />
64-
<Error Condition="!Exists('..\packages\CNTK.Deps.OpenCV.Zip.2.4.0\build\net45\CNTK.Deps.OpenCV.Zip.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.OpenCV.Zip.2.4.0\build\net45\CNTK.Deps.OpenCV.Zip.targets'))" />
65-
<Error Condition="!Exists('..\packages\CNTK.GPU.2.4.0\build\net45\CNTK.GPU.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.GPU.2.4.0\build\net45\CNTK.GPU.targets'))" />
66-
</Target>
6756
<ItemGroup>
6857
<Content Include="packages.config" />
6958
<Compile Include="AssemblyInfo.fs" />
@@ -84,15 +73,19 @@
8473
<None Include="Scripts\SetEnv.fsx" />
8574
<None Include="Scripts\TestDCGAN.fsx" />
8675
<None Include="Scripts\TestLstm.fsx" />
87-
<None Include="ScratchPad\T1.fsx" />
88-
<None Include="ScratchPad\CA1.fsx" />
89-
<None Include="ScratchPad\GridSearchCA.fsx" />
9076
<None Include="ScratchPad\LstmSimple.fsx" />
9177
<None Include="ScratchPad\Scratch.fsx" />
78+
<None Include="Local\readme.md" />
79+
<None Include="Local\T1.fsx" />
80+
<None Include="Local\CA1.fsx" />
81+
<None Include="Local\GridSearchCA.fsx" />
9282
</ItemGroup>
9383
<ItemGroup>
94-
<Reference Include="Cntk.Core.Managed-2.4">
95-
<HintPath>..\..\cntk\x64\Release\Cntk.Core.Managed-2.4.dll</HintPath>
84+
<Reference Include="Cntk.Core.Managed-2.5">
85+
<HintPath>..\packages\CNTK.GPU.2.5.0\lib\net45\x64\Cntk.Core.Managed-2.5.dll</HintPath>
86+
</Reference>
87+
<Reference Include="FSharp.Charting">
88+
<HintPath>..\packages\FSharp.Charting.0.91.1\lib\net45\FSharp.Charting.dll</HintPath>
9689
</Reference>
9790
<Reference Include="mscorlib" />
9891
<Reference Include="FSharp.Core">
@@ -110,10 +103,21 @@
110103
</Reference>
111104
<Reference Include="System.Windows.Forms" />
112105
</ItemGroup>
113-
<Import Project="..\packages\CNTK.Deps.cuDNN.2.4.0\build\net45\CNTK.Deps.cuDNN.targets" Condition="Exists('..\packages\CNTK.Deps.cuDNN.2.4.0\build\net45\CNTK.Deps.cuDNN.targets')" />
114-
<Import Project="..\packages\CNTK.Deps.MKL.2.4.0\build\net45\CNTK.Deps.MKL.targets" Condition="Exists('..\packages\CNTK.Deps.MKL.2.4.0\build\net45\CNTK.Deps.MKL.targets')" />
115-
<Import Project="..\packages\CNTK.Deps.OpenCV.Zip.2.4.0\build\net45\CNTK.Deps.OpenCV.Zip.targets" Condition="Exists('..\packages\CNTK.Deps.OpenCV.Zip.2.4.0\build\net45\CNTK.Deps.OpenCV.Zip.targets')" />
116-
<Import Project="..\packages\CNTK.GPU.2.4.0\build\net45\CNTK.GPU.targets" Condition="Exists('..\packages\CNTK.GPU.2.4.0\build\net45\CNTK.GPU.targets')" />
106+
<Import Project="..\packages\CNTK.Deps.Cuda.2.5.0\build\net45\CNTK.Deps.Cuda.targets" Condition="Exists('..\packages\CNTK.Deps.Cuda.2.5.0\build\net45\CNTK.Deps.Cuda.targets')" />
107+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
108+
<PropertyGroup>
109+
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
110+
</PropertyGroup>
111+
<Error Condition="!Exists('..\packages\CNTK.Deps.Cuda.2.5.0\build\net45\CNTK.Deps.Cuda.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.Cuda.2.5.0\build\net45\CNTK.Deps.Cuda.targets'))" />
112+
<Error Condition="!Exists('..\packages\CNTK.Deps.cuDNN.2.5.0\build\net45\CNTK.Deps.cuDNN.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.cuDNN.2.5.0\build\net45\CNTK.Deps.cuDNN.targets'))" />
113+
<Error Condition="!Exists('..\packages\CNTK.Deps.MKL.2.5.0\build\net45\CNTK.Deps.MKL.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.MKL.2.5.0\build\net45\CNTK.Deps.MKL.targets'))" />
114+
<Error Condition="!Exists('..\packages\CNTK.Deps.OpenCV.Zip.2.5.0\build\net45\CNTK.Deps.OpenCV.Zip.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.Deps.OpenCV.Zip.2.5.0\build\net45\CNTK.Deps.OpenCV.Zip.targets'))" />
115+
<Error Condition="!Exists('..\packages\CNTK.GPU.2.5.0\build\net45\CNTK.GPU.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\CNTK.GPU.2.5.0\build\net45\CNTK.GPU.targets'))" />
116+
</Target>
117+
<Import Project="..\packages\CNTK.Deps.cuDNN.2.5.0\build\net45\CNTK.Deps.cuDNN.targets" Condition="Exists('..\packages\CNTK.Deps.cuDNN.2.5.0\build\net45\CNTK.Deps.cuDNN.targets')" />
118+
<Import Project="..\packages\CNTK.Deps.MKL.2.5.0\build\net45\CNTK.Deps.MKL.targets" Condition="Exists('..\packages\CNTK.Deps.MKL.2.5.0\build\net45\CNTK.Deps.MKL.targets')" />
119+
<Import Project="..\packages\CNTK.Deps.OpenCV.Zip.2.5.0\build\net45\CNTK.Deps.OpenCV.Zip.targets" Condition="Exists('..\packages\CNTK.Deps.OpenCV.Zip.2.5.0\build\net45\CNTK.Deps.OpenCV.Zip.targets')" />
120+
<Import Project="..\packages\CNTK.GPU.2.5.0\build\net45\CNTK.GPU.targets" Condition="Exists('..\packages\CNTK.GPU.2.5.0\build\net45\CNTK.GPU.targets')" />
117121
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
118122
Other similar extension points exist, see Microsoft.Common.targets.
119123
<Target Name="BeforeBuild">

FsCNTK/Layers/Dense.fs

-22
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,9 @@ module Layers_Dense =
5353
let W = new Parameter(!--(input_shape + output_shape),dataType,init_weight,device,"W")
5454
let b = if bias then new Parameter(!--output_shape,dataType,init_bias,device,"b") else null
5555

56-
//python code swaps left and right parameters in its times function - don't know why
57-
//here we use the cntk function
58-
5956
let r = C.Times(W,x.Var,uint32 output_rank, infer_input_rank_to_map)
6057
let r = if bias then C.Plus(!>r, b ) else r
6158
let r = addActivation (F r) activation
6259
if !Layers.trace then printfn ">> Dense[%s] %A" name (O.shape r)
6360
r
6461

65-
////python uses late binding so shape is inferred
66-
////here we can just use the shape given
67-
//let input_shape = O.shape x
68-
69-
//let init_weight = B._initializer_with_rank (init, output_rank=output_rank)
70-
//let W = Node.Parm(input_shape + output_shape, init=init_weight,name="W")
71-
//let b = if bias then Node.Parm(output_shape,init=init_bias,name="b") |> Some else None
72-
73-
////python code swaps left and right parameters in its times function - don't know why
74-
////here we use the cntk function
75-
//let r = C.Times(W.Var,x.Var,uint32 output_rank, infer_input_rank_to_map) |> F
76-
////let r = O.times2(x,W, output_rank, infer_input_rank_to_map,"")
77-
//let r = match b with None -> W | Some b -> b + W
78-
//let r = addActivation r activation
79-
80-
//if !Layers.trace then printfn ">> Dense[%s] %A" name (r|>O.shape|>dims)
81-
82-
//r
83-

FsCNTK/Layers/Recurrence.fs

+4-3
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ module Layers_Recurrence =
145145
| _ -> None
146146

147147
{
148-
stack_axis = axisVector [new Axis(-1)]
148+
stack_axis = axisVector [new Axis(0)]
149149
stacked_dim = cell_dim
150150
cell_shape_stacked = cell_shape_stacked
151151
cell_shape_stacked_H = cell_shape_stacked_H
@@ -391,12 +391,13 @@ module Layers_Recurrence =
391391
let state_shapes,_ = step_function
392392

393393
let init_value = defaultArg init_value 0.0
394+
let cVal = new Constant(!>[|1|], dataType, init_value) :> Variable |> V
394395
let initial_states =
395396
match initial_states with
396-
| None -> state_shapes |> List.map (fun s -> new Constant(!>[|1|], dataType, init_value) :> Variable |> V )
397+
| None -> state_shapes |> List.map (fun _ -> cVal )
397398
| Some rs -> rs
398399

399400
let recurrence_from = L.RecurrenceFrom(step_function,go_backwards=go_backwards,name=name)
400401

401-
if !Layers.trace then printfn ">> Recurrence with %A" (initial_states |> List.map (O.shape>>dims))
402+
if !Layers.trace then printfn ">> Recurrence with %A" (state_shapes |> List.map (dims))
402403
recurrence_from initial_states x

FsCNTK/Local/readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
this folder is for storing temp script files that are not commited to the repo

0 commit comments

Comments
 (0)