Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101715282
Network.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 13, 00:30
Size
1 KB
Mime Type
text/x-python
Expires
Sat, Feb 15, 00:30 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24221026
Attached To
R13109 LPBF-Sinergia- SNF
Network.py
View Options
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 26 07:14:15 2023
@author: srpv
contact: vigneashwara.solairajapandiyan@empa.ch
contact: vigneashwara.pandiyan@tii.ae
The codes in this following script will be used for the publication of the following work
"Dynamics of in-situ alloying of Ti6Al4V-Fe by means of acoustic emission monitoring
supported by operando synchrotron X-ray diffraction"
@any reuse of this code should be authorized by the first owner, code author
"""
# %%
# Librariies to import
import
matplotlib.pyplot
as
plt
import
numpy
as
np
from
prettytable
import
PrettyTable
import
torch.nn
as
nn
import
torch
''' Network to be trained'''
class
Network
(
nn
.
Module
):
def
__init__
(
self
,
emb_dim
=
4
):
super
(
Network
,
self
)
.
__init__
()
self
.
conv
=
nn
.
Sequential
(
nn
.
Conv1d
(
in_channels
=
1
,
out_channels
=
8
,
kernel_size
=
32
,
stride
=
5
),
nn
.
BatchNorm1d
(
8
),
nn
.
PReLU
(),
nn
.
Dropout
(
0.1
),
nn
.
Conv1d
(
8
,
16
,
kernel_size
=
16
,
stride
=
3
),
nn
.
BatchNorm1d
(
16
),
nn
.
PReLU
(),
nn
.
Dropout
(
0.1
),
nn
.
Conv1d
(
16
,
32
,
kernel_size
=
8
,
stride
=
3
),
nn
.
BatchNorm1d
(
32
),
nn
.
PReLU
(),
nn
.
Dropout
(
0.1
),
nn
.
Conv1d
(
32
,
64
,
kernel_size
=
5
,
stride
=
3
),
nn
.
BatchNorm1d
(
64
),
nn
.
PReLU
(),
nn
.
Dropout
(
0.1
),
nn
.
Conv1d
(
64
,
128
,
kernel_size
=
3
,
stride
=
2
),
nn
.
BatchNorm1d
(
128
),
nn
.
PReLU
(),
nn
.
Dropout
(
0.1
),
)
self
.
fc
=
nn
.
Sequential
(
nn
.
Linear
(
128
*
17
,
256
),
nn
.
PReLU
(),
nn
.
Linear
(
256
,
64
),
nn
.
PReLU
(),
nn
.
Linear
(
64
,
emb_dim
),
)
def
forward
(
self
,
x
):
x
=
self
.
conv
(
x
)
x
=
x
.
view
(
-
1
,
128
*
17
)
x
=
self
.
fc
(
x
)
return
x
Event Timeline
Log In to Comment