Skip to content

Commit

Permalink
feat!: main content
Browse files Browse the repository at this point in the history
  • Loading branch information
gciatto committed Jun 28, 2022
1 parent 321041f commit 2d1f6d2
Show file tree
Hide file tree
Showing 8 changed files with 173 additions and 108 deletions.
3 changes: 2 additions & 1 deletion cilc-2022-logic-api-ml-talk.sty
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
\renewcommand{\thefootnote}{\fnsymbol{footnote}}
\usepackage{listings}
\usepackage{multicol}

\usepackage{adjustbox}
\usepackage{makecell}

%-----------------------------------------------------
% LISTING CONFIGURATIONS
Expand Down
165 changes: 118 additions & 47 deletions cilc-2022-logic-api-ml-talk.tex
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
% version
\newcommand{\versionmajor}{0}
\newcommand{\versionminor}{4}
\newcommand{\versionmajor}{1}
\newcommand{\versionminor}{0}
\newcommand{\versionpatch}{0}
\newcommand{\version}{\versionmajor.\versionminor.\versionpatch}
%
Expand All @@ -26,7 +26,7 @@
% same authors order of the presented paper
\author[\sspeaker{Ciatto}, Castigliò, Calegari]{
\speaker{Giovanni Ciatto}$^{*}$ % empth the presenting author
\and
\and
Matteo Castigliò$^{\dagger}$
\and
Roberta Calegari$^{\S}$
Expand Down Expand Up @@ -64,25 +64,29 @@ \section{Context, Motivation, \& Goals}

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}[c]{Context}

\begin{itemize}
\item Prolog is the most prominent LP technology out there\ccite{prolog50years-tplp,lptech4mas-jaamas35}
\item Prolog is the most prominent LP technology\ccite{prolog50years-tplp}
%
\begin{itemize}
\item used to implement other logic-based technologies
\item used to implement other logic-based technologies\ccite{lptech4mas-jaamas35}
\end{itemize}

\vfill
\item Plenty of libraries supporting ML in mainstream programming languages

\item Plenty of libraries supporting ML in mainstream languages
%
\begin{itemize}
\item main features: training, (de)serialising, or using ML predictors
\item[eg] Scikit-Learn or Tensorflow for Python, Smile or \deeplearningforj{} on the JVM
%
\begin{itemize}
\item[eg] Scikit-Learn or Tensorflow for Python
\item[eg] Smile or \deeplearningforj{} on the JVM
\end{itemize}
\end{itemize}

\vfill

\item Poor interoperability among LP and ML
%
\begin{itemize}
Expand All @@ -101,27 +105,27 @@ \section{Context, Motivation, \& Goals}
\begin{itemize}
\item especially for what concerns the ``LP calls ML'' case
\end{itemize}

\vfill

\item Support the exploitation of ML predictors in LP
%
\begin{itemize}
\item[eg] for training, (de)serialising, or using them
\item[eg] for training, (de)serialising, or using them
\end{itemize}

\vfill

\item Enable the exploitation of trained predictors as logic predicates

\vfill

\item Support the implementation of hybrid systems
%
\begin{itemize}
\item[ie] where symbolic AI is used to govern or combine sub-symbolic predictors
\end{itemize}

\end{itemize}
\end{frame}
%\\\\\\\\\\\\\\\\\\\\\
Expand All @@ -136,15 +140,15 @@ \section{Context, Motivation, \& Goals}
\item[ie] a set of logic predicates for working ML, in LP
\item covering all phases of a ML workflow
\end{itemize}

\vfill

\item Design a technological architecture for re-using existing ML libraries

\vfill

\item Select technologies for prototyping the API

\vfill

\item Highlight the (expected) benefits
Expand Down Expand Up @@ -176,26 +180,26 @@ \subsection{The \twopkt{} Logic Ecosystem}
\item Kotlin-based implementation of a logic ecosystem
\item multi-platform, multi-OS, multi-paradigm
\end{itemize}
\end{block}
\end{block}

\begin{center}
\includegraphics[width=.7\linewidth]{figures/project-map.png}
\includegraphics[width=.7\linewidth]{figures/project-map.png}
\end{center}

\vspace{-.5cm}

\begin{multicols}{2}
\begin{itemize}\small
\item knowledge representation

\item \ldots and storage

\item \ldots and parsing/presentation

\item Prolog-like inference support
%
\item \ldots or concurrent / probabilistic

\item LP--OOP interoperability
\end{itemize}
\end{multicols}
Expand All @@ -216,7 +220,7 @@ \subsection{The \twopkt{} Logic Ecosystem}

\begin{itemize}
\item Logic solvers as \alert{oracles} queried by users

\vfill

\item Generators as \alert{gateways} towards the external world
Expand All @@ -233,13 +237,13 @@ \subsection{Expected benefits}

\begin{itemize}
\item Hybrid reasoning

\item Declarative ML

\item Symbolic data sources

\item Model selection via resolution

\end{itemize}

\end{frame}
Expand Down Expand Up @@ -280,37 +284,104 @@ \subsection{Expected benefits}
\item use logic theories as datasets, and train predictors upon them
\end{itemize}

\prologimport{listings/logic-dataset-loading.pl}
\prologimport[basicstyle=\tiny\ttfamily]{listings/logic-dataset-loading.pl}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}[allowframebreaks]
\frametitle{Model selection via resolution}

\begin{itemize}
\item exploit the non-determinism of resolution explore all possible choices
\end{itemize}

\prologimport%[basicstyle=\tiny\ttfamily]
{listings/training.pl}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\

\section{Conclusions \& future works}
\subsection{Architectural Overview}

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}%[allowframebreaks]
\frametitle{Conclusions \& future works}
\frametitle{Most relevant components}

\begin{block}{Summing up}
Summarise the most relevant contributions of this study:
\begin{columns}
\column{.44\linewidth}
\centering
\includegraphics[width=\linewidth]{figures/layers.pdf}
\column{.56\linewidth}
\begin{itemize}
\item a library of logic predicates (\mllib)
\item some underlying OOP library for ML
\item some underlying LP facility
%
\begin{itemize}
\item supporting OOP-interoperability
\end{itemize}
\end{itemize}
\end{columns}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\

\subsection{Main logic API}

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}%[allowframebreaks]
\frametitle{About the \mllib{}}

\includegraphics[width=\linewidth]{figures/entities.pdf}
%
\begin{itemize}
\item conclusion 1
\item conclusion 2
\item conclusion 3
\item 4 main kinds of entities: Schema, Dataset, Transformation, Predictor
%
\begin{itemize}
\item plus many ancillary ones (e.g. Parameter, Neural Network, Layer)
\end{itemize}
\item many predicates supporting their creation an manipulation in LP
\end{itemize}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\

\subsection{Technology Selection}

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}%[allowframebreaks]
\frametitle{Technology Selection for the JVM}

\input{tables/technologies.tex}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\

\section{Conclusions \& Future works}

%\\\\\\\\\\\\\\\\\\\\\
\begin{frame}%[allowframebreaks]
\frametitle{Conclusions \& Future works}

\begin{block}{Summing up}
\begin{itemize}
\item Design a corpus of predicates supporting ``LP calls ML''
\item Identify key architectural requirements for its implementation
\item Select technologies and prototype for the JVM
\end{itemize}
\end{block}

\begin{exampleblock}{Future works}
Sketch some future research directions
%
\begin{exampleblock}{Future Works}
\begin{itemize}
\item future work 1
\item future work 2
\item Port \twopkt{} on Python\footnotemark{}, find some ML tech. \& prototype
\item Complete support for non-neural predictors
\item Experiment the creation of actual hybrid systems
\end{itemize}
\end{exampleblock}

(may be split into 2 slides)
\footnotetext{see \url{https://github.com/tuProlog/2ppy}}

\end{frame}
%\\\\\\\\\\\\\\\\\\\\\
Expand Down
Binary file modified figures/entities.pdf
Binary file not shown.
62 changes: 31 additions & 31 deletions figures/entities.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figures/layers.pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions listings/hybrid-predictor.pl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* assumption: */
:- (*@\label{line:hybrid-predictor-setup}@*)iris_dataset(D), iris_schema(S), model_selection(D, S, N, T, _), !,
assert(iris_nn(N, T)).
:- (*@\label{line:hybrid-predictor-setup}@*)iris_dataset(D), iris_schema(S),
model_selection(D, S, N, T, _), !, assert(iris_nn(N, T)).

/* hybrid iris classifier */
/* hybrid iris classifier */
iris(SL, SW, PL, PW, Species) :-
iris_nn(Network, Transformation),
transform([SL, SW, PL, PW] , Transformation, ActualX),
transform([SL, SW, PL, PW] , Transformation, ActualX),
predict(Network, ActualX, Y),
classify(Y, argmax, [setosa, versicolor, virginica], Species).
32 changes: 12 additions & 20 deletions listings/training.pl
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/* Hyper paramenters */
hidden_layers([10]). hidden_layers([20, 10]).
hidden_layers([30, 20, 10]).
hidden_layers([10]). hidden_layers([20, 10]).

/* Learning paramenters */
max_epochs(30). max_epochs(50).
batch_size(32). batch_size(16).
learning_rate(0.01). learning_rate(0.1).
loss(cross_entropy).
max_epochs(30). max_epochs(50). batch_size(32).
batch_size(16). learning_rate(0.01). loss(cross_entropy).

/* Workflow paramenters */
target_performance(0.90). test_percentage(0.2).
Expand All @@ -16,22 +13,17 @@
[hidden_layers(H)],
[iterations(X), learning_rate(Y), batch_size(Z), loss(L)]
) :- hidden_layers(H), max_epochs(X), learning_rate(Y),
batch_size(Z), loss(L).

/* Generates and trains all Predictors for the given Dataset and Schema,
whose Performance is at least target_performance. */
model_selection(Dataset, Schema, Predictor, Transform, Performance) :-
test_percentage(R), target_performance(T),
batch_size(Z), loss(L).(*@\framebreak@*)
% Generates and trains all Predictors for the given Dataset
% and Schema, having at least a given performance.
model_selection(Dataset, Schema, Predictor) :-
test_percentage(R), target_performance(Threshold),
random_split(Dataset, R, TrainSet, TestSet),
preprocessing_pipeline(TrainSet, Schema, Transform),
transform(TrainSet, Transform, ProcessedTrainSet),
params(HyperParams, LearnParams),
train_cv(ProcessedTrainSet, HyperParams, LearnParams, P),
P >= T,
train_cv(TrainSet, HyperParams, LearnParams, Performance),
Performance >= Threshold,
multi_layer_perceptron(4, HyperParams, NN),
train(NN, TrainingSet, LearnParams, Predictor),
transform(TrainSet, Transform, ProcessedTestSet),
test(NN, ProcessedTestSet, Performance).
train(NN, TrainSet, LearnParams, Predictor).

/* Example of training query: */
?- iris_dataset(D), iris_schema(S), (*@\label{line:training-query}@*)model_selection(D, S, P, _, A).
?- iris_dataset(D), iris_schema(S), (*@\label{line:training-query}@*)model_selection(D, S, P)
11 changes: 6 additions & 5 deletions tables/technologies.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

\begin{table}
\begin{adjustbox}{width=\textwidth,center}
\begin{tabular}{c||c|c|c|c}
Expand All @@ -18,8 +19,8 @@
Weka & Waikato University & Stable & Developed & Excellent
\end{tabular}
\end{adjustbox}
\caption{Recap of the analysed technologies and their features}
\label{tab:tech-features}
% \caption{Recap of the analysed technologies and their features}
% \label{tab:tech-features}
\end{table}

\begin{table}
Expand All @@ -42,6 +43,6 @@
Weka & Yes & Yes & Yes & Yes & via \dlfj
\end{tabular}
\end{adjustbox}
\caption{Recap of the analysed technologies and the functionalities they support}
\label{tab:tech-functionalities}
\end{table}
% \caption{Recap of the analysed technologies and the functionalities they support}
% \label{tab:tech-functionalities}
\end{table}

0 comments on commit 2d1f6d2

Please sign in to comment.