text:
How to identify the face of a certain customer in a grocery store?
How would you solve the problem of identifying certain customer in a grocery store? Suppose our client is already signed-up on our website with an unique ID given to him. To come in to the store, firstly he must place a phone with a QR code in front of the reader, so that our server is informed on a specific client entering the shop. Then after successful authentication he heads towards the shelf with goods and pick some item. Identifying product name turned out not to be a challenge, as opposed to person.
From my perspective, the solution is to make a several photo of face from a different angle while person coming in. Quickly train CNN and feed it with face images when customer picks goods in order to choose the corresponding one.
So, what are your thoughts on this issue? What approach would you take to work it out?

What if she will wear sunglasses? What if she will have some makeup? What if he is not shaved today? What if she returned from holidays and is sunburned? What if he was hit on his eye and have a limo?

The point is to train network in a short term period: this time frame is made up of entry point up to the shelf with goods.

You might consider pre-training a CNN on a large dataset. The CNN should be structured such that you input 2 different images and the CNN predicts whether or not they are the same person. Your dataset should include images from multiple angles, with and without occlusions like sunglasses, and with changes in hair. (One dataset useful for this is the AR Face Database.) Then you can just check if the face matches any of the pictures you took as they entered the store.

This answer might be improved with some links, but it looks like good, general advice regardless, so thanks for contributing!


text:
How to describe an keras Model in a scientific report
how would you describe a machine learning model in a scientific report? It should be detailed but I just listed the hyperparameters... Have you got more important properties?

i would recommend reading a scientific paper and following their procedure / copying whatever they list; if its for a blog-post then just put in anything that you think matters

Some other details you could mention are:

total number of model parameters (e.g. 1.2M or 0.15M) & depth of the network (e.g. 38-layered network)
family/style of the network architecture (e.g. encoder-decoder arch., LSTM)
specifics of connections between network layers (e.g. residual-, dense-, skip-connections)
specifics of individual components of the network structure (e.g. dilated-convs. (CNNs), attention (LSTMs))
description/reasoning of why you chose a particular structure/sequence of connections in your deep learning model
specifics of training/validation/testing procedures (e.g. augmented training data, cross-validation, test-time-augmentation (TTA), frozen network weights)
other specific details/caveats that allow the results of your deep learning model be easily reproduced from the scientific report

For more info on the best kinds of details to be included in the report, refer to "Methodology"/ "Training"/ "Implementation"/ "Proposed Architecture" sections of the deep learning research papers in your relevant area.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
What is "Computational Linguistics"?
It's not clear to me whether or not someone whose work aims to improve an NLP system may be called a "Computational Linguist" even when she/he doesn't modify the algorithm directly by coding.
Let's consider the following activities:
Annotation for Machine Learning:
analysis of Morphology, Syntax, POS tagging
Annotation, analysis, and annotation of entities (NER) and collocations; supporting content categorization; chunking; word sense disambiguation.
Recording of technical issues of the annotation tool to improve its reliability.
Recording of linguistic and logical particular rules adopted by the research team who develops the NLP algorithm to improve consistency between annotation and criteria previously adopted to train the NLP.
May be these activities considered "Computational Linguistics"? If not, which is their professional category and how should they be included in the resume in a word which synthesizes them?

(Disclosure: I am a researcher and lecturer in Computational Linguistics)
It is true that annotation and debugging work with existing tools without modification can be considered Computational Linguistics.
And yet, most Computational Linguists program on a daily basis, since they actively develop tools. Just to give you some context, at major Computational Linguistics conferences such as ACL or EMNLP (the biggest ones), most authors did the coding themselves.
To say that coding is an unimportant side aspect of being a Computational Linguist, as claimed in another answer, is a slight misrepresentation.

It depends. I studied Computational Linguistics, and currently work as a computational linguist. My day-to-day work does not involve much coding at all. So I'd say that programming on a daily basis is also a slight misrepresentation :) It also depends if you are more on the Computer Science side, or on the Linguistic side of it. CL is inherently interdisciplinary, so I guess we just have different experiences of it.

@OliverMason You are describing your individual experience, while I am trying to describe the research field as a whole. I still maintain that saying that programming is the "least important" aspect of CL is a misrepresentation. If the head of department at your university does not do any coding and never did, he is an outlier among heads of departments of CL.

I'm looking beyond academia; so I guess we just have to agree to disagree on this.

Yes. A computational linguist is someone who (among other things) uses computers to process/model/analyse/... natural language. Coding might be one aspect of it, but is about the least important: you can always get a non-linguist programmer to do coding for you.
I studied "Computational Linguistics" at university, and while programming was taught as part of the course, coding was only a minor aspect in the actual subject matter. The senior professor (and head of the department) wasn't able to do any coding himself; he came from the linguistics side of it.
Being able to program is useful, as it speeds things up and makes you more independent, but it is by no means an important part of being a computational linguist.
UPDATE: I have been accused of misrepresenting the field of CL. However, it is a broad, interdisciplinary field, and comprises many elements. Sure, on the academic/research side you might do more programming than in the applied/commercial side, but I maintain that you can easily work as a computational linguist without actually doing any programming. For most tasks, readily available software exists by now, so you don't actually need to program anything new.

Thank you for answering (I edited the title of the Q to make it more clear though). Therefore someone who does annotation for ML and all the activities described above is a computational linguist, right?

@franz1 Annotation is part of the typical activities of a computational linguist these days, yes.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Understanding the pseudocode of uniform-cost search from the book "Artificial Intelligence: A Modern Approach"
On page 84 of Russell & Norvig's book "Artificial Intelligence: A Modern Approach Book" (3rd edition), the pseudocode for uniform cost search is given. I provided a screenshot of it here for your convenience.
I am having trouble understanding the highlighted line if child.STATE is not in explored **or** frontier then

Shouldn't that be
if child.STATE is not in explored **and** frontier then
The way it's written, it seems to suggest that if the child node has already been explored, but not currently in the frontier, then we add it to the frontier, but I don't think that's correct. If it's already been explored, then it means we already found the optimal path for this node previously and should not be processing it again. Is my understanding wrong?

I think this is a problem with missing brackets in pseudocode — clearly the state is only added to the frontier if it hasn't been explored already, so it would be:
if not [contains(frontier, state) OR contains(explored, state)] then

which is equivalent to your interpretation of
if not [contains(frontier, state)] AND not [contains(explored, state)] then

(according to De Morgan's Laws)
Being half-way between a programming language and natural language, this is a case where pseudocode is not quite precise enough.


text:
What does it mean if classification error is equal between two networks but the MSE is different?
I'm experimenting with training a feedforward neural network using a genetic algorithm and I've done a few tests using both the mean squared error and classification error functions as fitness heuristic in the GA.
When I use MSE as error function, my GA tends to converge around an MSE of 0.1 (initial conditions have an MSE of around 0.9). Testing system accuracy with this network gives me 95%+ for both training and testing data.
But, when I use classification error as my heuristic, my GA tends to converge around when the MSE is about 0.3. System accuracy is still around the same at 95%+.

My question is, if you had two networks, one showing an MSE of 0.1 and one an MSE of 0.3, but both perform approximately the same in terms of accuracy, what can I deduce from the differences in MSE?

In other words: which network is "better", even if the accuracy is the same? Does a lower MSE mean anything below a certain amount? I could train my network for 100x as many generations and get a better MSE but not necessarily a better accuracy. Why?
For some context:

When the MSE is approximately 1.5 (epoch 250), the accuracy seems to match when the MSE is approximately 2.0 (epoch 50). Why does the accuracy not increase despite MSE decreasing?

MSE just measures the squared difference between actual and target values. It can still correctly classify the values, but perhaps not with the same confidence - leading to a higher loss (e.g. an output of 0.77 vs 0.98 when the target is 1). In terms of which is better, I wouldn't know without the specifics of your problem. It is possible the higher loss could be more robust since it is less likely to have overfitted on the data, yet achieves the same accuracy.

Accuracy itself isn't a sufficient way to compare two models. For example, you need to consider the precision and recall stats (see confusion matrix) and calculate some other metrics like f1 score. The measurement of accuracy is only the initial state that helps us to know if a model is "working". But in order to understand and compare you need to know how many of impostors' set were classified as true claimants, and how many true-claimants' set classified as impostors according to the sum of total correct classified ones. In order to make a decision with the above been known you have to define how critical a miss-classification could be? e.g. assume that you need to classify if a person has a disease or not? (that's critical).


text:
Is increasing software complexity the most likely bottleneck to the AI singularity?
From Wikipedia:

According to the most popular version of the singularity hypothesis, called intelligence explosion, an upgradable intelligent agent will eventually enter a "runaway reaction" of self-improvement cycles, each new and more intelligent generation appearing more and more rapidly, causing an "explosion" in intelligence and resulting in a powerful superintelligence that qualitatively far surpasses all human intelligence.

But what if the complexity of the problem of self-improving the software grows at a faster rate than the AGI intelligence self-improvement?
From experience we know that problems tend to be harder to solve at every iteration, with diminishing returns. Take as an example the theory of gravitation. Newtonian physics is relatively easy to formulate and covers the majority of high level gravitation phenomenas.
A more refined picture, like General Relativity, fill few holes in the theory with a huge increase in complexity. To describe black holes and primordial cosmology we need a theory of quantum gravity, which appears to require a further step in complexity.
What "saved" us so far is the economic growth of our civilisation, which allowed more and more scientist to focus on solving the next problems. It's true that the first AGI will have the luxury of being duplicated, being a software base intelligence, but at the same time is likely that the first AGI will be extremely compute intensive. But even assuming that we (or maybe it would better to say, they) have the hardware to run $10^{2}$ instances, if the complexity of every substantial self-improvement grows say by $10^{d}$x with $d=3$ while the improvement to the intelligence is only $10^{l}$x with $l=1$, the self-improvement cycle will quickly slow down.
So is increasing software complexity the most likely bottleneck to the AI singularity? And what are likely values for $d$ and $l$?

"It's true that the first AGI will have the luxury of duplicating himself", it's true according to whom? The first AGI could actually not be able to duplicate itself, if by duplicate you mean reproduce. In fact, there are animals that can't procreate, such as mules (if I remember correctly), but they are still intelligent. So, I suggest that you revise your post to remove these "highly dubious" statements or at least use hypothetical statements. Moreover, I suggest that you ask a question that will not lead to opinions. Maybe you can formulate your question in that way.

I meant duplicated, edited the question. Likely the AGI will be created by an organisation, which could easily run multiple instances of it. I agree that self duplication at the beginning could be challenging.

I think it's very difficult, if not impossible, to answer your questions appropriately, because, unless there's some mathematical theory that allows us to make predictions about a future AGI or SI, and how they will evolve, we can just speculate. My knowledge of physics is limited to high school, but I think a plausible prediction is that recursive self-improvement, if possible, will be a lot slower than people think.

It's a very interesting question, and I definitely understand what you are getting at.  (Might be worthwhile to look at this not from the standpoint of AGI or superintelligence, but from the standpoint of a predictive function, like Laplace's Demon.  One idea of the singularity would be the idea of ultimately being able to simulating the entire observable universe, and the question of whether that is computationally possible.)  Does the cost of computation eventually become too great?

What if the complexity of the problem of self-improving the software grows at a faster rate than the AGI intelligence self-improvement?

If this turns out to be the case, then the complexity would indeed be the bottleneck.
There's a formal term for this: kolmogrov complexity or "k-complexity".  (The best formal definition of intelligence I've come across is Hutter & Legg's, which is broken down in the article "On the definition of intelligence" by our own nbro.  It will shed shed some light on the formal structure of the question at hand.

Any attempt to provide values to your d & l would speculative, since we're still so far from AGI. The question would be what is the effect of any given (d,l)

The subject can definitely be treated formally in a mathematical sense the and values analyzed.  (There may even been some formulae out there, although, they are likely to be more complex, per the Hutter&Legg.)
Sorry I can't give you a more formal answer--it's a good question!

Notes:
Another bottleneck would be the speed of light, essentially, "bits and bytes across a pipeline".  This would be a factor in both self-replication and networked processing and memory.  You can expand bandwidth/throughput, but not infinitely.
This relates to space complexity (how much volume/memory does the algorithm require?) in addition to the k-complexity, which itself is likely to be non-trivial for anything approaching AGI.
AI Threat:
From the standpoint of neoluddism, I'm skeptical that "infinitely" self-optimizing superintelligence is the greatest threat.  Evolution, and economic theory, suggest that the greater danger would come from not what is most expensive, complex, & capable, but that which is "just good enough", cheaper and more easily replicable.  This is because decision time becomes a critical factor in a competitive environment, as does replication time.
I always bring up grey goo because it only has to be good at 1 thing to eat everything else!


text:
Compressing text using AI by sending only prediction rank of next word
Is there any effort made to compress text (and maybe other media) using prediction of next word and thus sending only the order number of the word/token which will be predicted on the client side
i.e
Server text: This is an example of a long text example, custom word flerfom inserted to confuse, that may appear on somewhere
Compressed Text transmitted : This [choice no 3] [choice no 4] [choice no 1] [choice no 6] [choice no 1] [choice no 3] [choice no 1], custom word flerfom [choice no 4] inserted [choice no 4] confuse [choice no 5] [choice no 4] [choice no 6] [choice no 5] on somewhere
(Note: of course [choice no 3] will be shortened to [3] to save bytes and also maybe we can do much better in some cases by sending the first letter of the word)
of course it means that the client side neural network has to be static or only updated in a predictable fasion, so the server knows for sure that the client neural network's predictions will follow the given choice orders. I tried example with https://demo.allennlp.org/next-token-lm, but the prediction is not that good. maybe gpt-3 can do better . but its too heavy for use in a normal pc / mobile device
In more details, the process is
Deploy the same model on both sides
Predict the next word after the starting word
Keep the prediction limit say 100
For any word which have more than 2 characters we do the prediction
If the current word is predicted within the top 100 predictions of the model , we can essentially replace it with a numeric char between 0-99 (inclusive) so we are replacing a say , 5 character word with a 2 character numerical char..
And if the word is not predicted in top 100 we send the word as it is..
As much better the model predicts, that much better the compression
And under no scenario it will work worse than the existing method..

So, essentially, the twin models have complete information on the decision making process of the the other?  It's an interesting idea, and, in theory, should work.  (One issue could be transmission noise, but that can be mitigated with redundant signals per information theory.)

@DukeZhou well yes. I mean if you have same weights and other things same, then predictions should be always same right ?

If you have a fixed predictor, then yes. If the predictor is not fixed but deterministic, the feasibility depends on the effort needed to update the predictor, and ensuring that messages include a time stamp to ensure the correct version of the predictor is used for compression and inflation.
You get a really nice property if the prediction order is in order of probability that the word occurs, and if you use fewer bits for lower numbers. You would get something that is pretty close to Shannon coding, which is not optimal but is still valid.

Thanks for the reply. I guess the main challenge is to make it fast yet, effective. i guess having a limit of 100 predictions can work. I wonder if there is any research , research paper or program/demos etc done for this concept.

In more detail the approach is
Deploy the same model on both sides
Predict the next word after the starting word
Keep the prediction limit say 100
For any word which have more than 2 characters we do the prediction
If the current word is predicted within the top 100 predictions of the model , we can essentially replace it with a numeric char between 0-99 (inclusive)


text:
Is there an AI tool to reverse engineer scanned data to obtain its CAD file?
Today, if you scan an object and want its CAD file (Solidworks/Autocad), you need to use reverse engineering software (Geomagic). This takes time and you need experience of the software tools.
Is there an AI tool/app that does the job automatically? If not, is this a reasonable idea to develop an AI application capable of doing it? What would be the biggest challenges?

Two years later, it seems there is no (open) project to train AI on engineering data and no AI tool to reverse engineer things yet.
The growing number of open source hardware projects should provide a good basic training set.. https://oho.wiki and https://certification.oshwa.org/list.html provide catalogues of specimens for example.. Realtime 3d generation should also be good enough by now to get this going..

As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.


text:
How is visual attention mechanism different from a two branch convolutional neural network?
I am doing some research on the visual attention mechanism in remote sensing domain (where the features learnt from one layer are highlighted using the attention mask derived from another layer). From what I have observed, the attention mask is learnt in a similar fashion as any other branch in CNN. So, what is so special about the visual attention mask that makes it different from a regular two branch CNN? The reference papers are provided below:
Visual Attention-Driven Hyperspectral Image Classification (IEEE, 2019)
A Two-Branch CNN Architecture for Land Cover
Classification of PAN and MS Imagery (MDPI, 2019)

Welcome to SE:AI!  (I've edited to include the titles of the papers, and publication journal and year--always better to be explicit in service of search.)


text:
Is there an online RL algorithm that receives as input a camera frame and produces an action as output?
I want to build a reinforcement learning model, which takes a camera picture as input, that learns online (in terms of machine learning). Based on the position of an object on the camera, I want the model to output an action. That action would be a stepper motor, that either moves to the right or left. This process would be repeated until a given goal/position is reached.
I can't go to the lab at the moment, so I wrote a virtual environment and let the agent live in that.
I am trying a neural network with the cross-entropy function. For small environments, this works fine. However, when I increase the size of the environment, the computation becomes really really slow and the model needs a lot of data input until it starts to learn. Also, it only learns offline. But what I would rather want is a model that learns online and only takes a few tries until it understands the underlying pattern. That isn't a problem for the virtual environment, since I can easily get thousands of data samples. But in the real environment, it would take ages this way.

Is there an online reinforcement algorithm that could help me out (instead of training the neural network with the cross-entropy loss function)?

You may want to look for Heirarchical Q Learning. And of course sending input as a series of frame rather than a single frame would be better. Yet, another improvement can be made by improving the input by removing unnecessary features. For example, your problem might not require colored image as an input so convert your image into grayscale before you move on to learn from it.


text:
Which NLP applications are based on recurrent neural networks?
Some of the NLP applications taken from this link NLP Applications:

Machine Translation
Speech Recognition
Sentiment Analysis
Question Answering
Automatic Summarization
Chatbots
Market Intelligence
Text Classification
Character Recognition
Spell Check

Which are the NLP applications that supports recurrent neural network?

Speech recognition and Character recognition are not part of NLP. Everything else on your list can in principle be done with RNNs. But the field is quickly moving towards using transformers.

I wanted just to add that RNN can also be used for speech recognition, even if it is not an NLP task.

Why aren't speech recognition and character recognition part of NLP? Also, in principle, many things can be done, so it may be useful to show that RNNs have already been used to solve the specific tasks.

Other tasks that RNNs are effective at solving are time-series predictions or other sequence predictions that aren’t image or tabular based.


text:
2 Partition Problem
I want to solve the two partition problem (https://en.wikipedia.org/wiki/Partition_problem) using an uninformed search algorithm (BFS or uniform cost).
The states can be represented by three sets S1,S1,S where the set S contains unassigned values and S1 and S2 the values assigned to each partition respectively. At the initial state S will contain all values and S1 and S2 will be empty. The actions consist in moving a value from S to S1 or S2. The objective is to find a complete assignation (S is empty) where abs(sum(S1)-sum(S2)) is minimum. As you can see I have all elements but the cost of the actions.

How can I assign costs to the actions in order to apply one of those algorithms? (Costs must be positive.)

I know it is not the best way to solve this problem but there must be a way to do it because the problem is formulated this way in the book.


text:
Is having binary randomized unchanging neural network weights a good idea?
I am creating a neural network to experiment with, and I was wondering:

If I have weights randomly initialized to be either 1 or 0 for each neuron, and then I made it so that the weights cannot be changed, would that ruin the neural network? What would happen?

Note: There is no bias in this network.

Hi and welcome to AI SE! Your question isn't completely clear to me. You say "would that ruin the neural network?", but what do you mean by "ruin"? And do you mean during learning or inference? If you randomly initialise the weights and then do not train the network, your network won't probably be able to do anything that you want. Either you are not understanding how neural networks work or you didn't express yourself well. Please, edit your post to clarify this.

If the weights cannot change there is no point in training the network since the whole idea of a neural net is to adjust the weights to reduce training loss. I think you need help understanding neural networks. I highly recommend tutorial sequence on YouTube at https://www.youtube.com/watch?v=gZmobeGL0Yg&list=PLZbbT5o_s2xq7LwI2y8_QtvuXZedL6tQU

Worth clarifying if you mean all the weights are locked to 0 or 1 like this, or just some of them. Also, what you hope to achieve by doing this, as it seems like an unmotivated experiment


text:
Has there been any work done on AI-driven operant conditioning?
For example, a RL algorithm that gains points when a rat presses a lever and loses points when it dispenses a pellet, water, treat, and/or sugar water. After a few days of controlling the rewards given to a rat, all rewards are stopped and the longer/more times the rat presses the lever before giving up, the higher the score.
This would be a situation in which both the input and the outputs are discrete with very low data density over time and with outputs having very long-term affects on the environment.
What kind of RL architecture would be appropriate here?


text:
Does bottleneck size matter in Disentangled Variational Autoencoders?
I suppose that picking an appropriate size for the bottleneck in Autoencoders is neither a trivial nor an intuitive task. After watching this video about VAEs, I've been wondering: Do disentangled VAEs solve this problem?
After all, if the network is trained to use as few latent space variables as possible, I might as well make the bottleneck large enough so that I don't run into any issues during training. Am I wrong somewhere?


text:
Deepfakes as "force for good"?
As per the law of unintended consequences, could it be that deepfakes will eventually have the opposite effect to what people currently seem to fear most. For example, once it is clear that anyone can be deepfaked to unlimited degrees of precision, wouldn't we have a situation where in regards to

pornography, revenge-porn: no one (including the person being viewed) will actually care anymore. E.g. if a movie star's account gets hacked and nude pictures are released to the public, it becomes a non-story because everone simply assumes it's one of thousands of other deepfakes that already exist.
fake-news, government propaganda: the general public will demand multiple sources, witnesses before believing the next crazy story. That, I assume, is a good thing as well.

regarding your second point: multiple sources are too much work for most people, so they will probably just stop believing anything they disagree with, which most likely will be the real, non-faked, news :(

@OliverMason I agree the second point is probably more wishful thinking... reality can be a bummer so why not just do internet searches beginning with "Why my (incorrect, unchangeable) opinion on X is the best" to find some random positive reinforcement on anything.

Welcome to AI.SE @Oozecandy. It looks like there may be an interesting question here, but as written now, it's not clear to me what this is asking, or what kind of answers you might be hoping to receive. Since we are a Q&A site, not a discussion site, it would be very helpful if you revised your question.

@JohnDoucette Thanks very much for welcoming me. I see- as this is not a discussion site and I framed the "question", more or less, as something to be discussed, there is no real way to acceptably answer it without including further information on my intentions. I need a moment to think and will try to reformulate... if not possible, should I just delete the post? If someone has a better suggestion, let me know.

@Oozecandy Yes, you can delete the question. There should be a button under your question that you can use for such a purpose. However, I suggest you reformulate the question in such a way that it can be answered objectively. Moreover, please, try asking just one question.


text:
How to solve Snake Game with a Hamiltonian graph algorithm?
I wonder if there is a way to solve snake game using Hamiltonian algorithm?
if there is a way

how to apply it?
what data structure will be used with algorithm?
time complexity and space complexity?
is this algorithm an optimal solution or there is a better way?

https://youtu.be/tjQIO1rqTBE?t=947 is a good video that uses a Hamiltonian cycle to achieve this. No, this is not optimal in terms of time (it takes a longer to reach some lengths then other methods do) but it is perfect, and will eventually get to the maximum length.

A Hamiltonian path in a graph is a path that visits all the nodes/vertices exactly once, a hamiltonian cycle is a cyclic path, i.e. all nodes visited once and the start and the endpoint are the same.
If we want to solve the snake game using this, we could divide the playable space in a grid and then try to just keep traversing on a hamiltonian cycle, this means you would eventually get all the rewards and never hit yourself unless you are longer than can fit on the screen.
You can look at the code given in this Github repo.
Note that this method, as you can tell, is not going to be optimal by time, there could be better solutions than this.
You will have to use a graph to store all the nodes and the complexity is supposed to be O(n!).


text:
Why the error rates in table3 and table4 are differenct in the paper "deep residual learning for image recognition"
Why are the error rates in table 3 and table 4 are different in the paper Deep Residual Learning for Image Recognition (2015).
They are both error rates on the validation sets by single model.

Why there are different rates for the same architecture?


text:
Is randomness anti-logical?
I came across a comment recently "reads like sentences strung together with no logic."  But is this even possible?
Sentences can be strung together randomly if the selection process is random. (Random sentences in a random sequence.) Stochasticity does not seem logical—it's a probability distribution, not based on sequence or causality.
but
That stochastic process is part of an algorithm, which is a set of instructions that must be valid for the program to compute.
So which is it?

Is randomness anti-logical?

Some definitions of computational logic:
The arrangement of circuit elements (as in a computer) needed for computation
also: the circuits themselves Merriam Websters  A system or set of principles underlying the arrangements of elements in a computer or electronic device so as to perform a specified task. Logical operations collectively. Google Dictionary
The system or principles underlying the representation of logical operations. Logical operations collectively, as performed by electronic or other devices.
Oxford English Dictionary
Some definitions of randomness
Being or relating to a set or to an element of a set each of whose elements has equal probability of occurrence. Lacking a definite plan, purpose, or pattern.
Merriam Websters. Made, done, happening, or chosen without method or conscious decision. Google Dictionary Having no definite aim or purpose; not sent or guided in a particular direction; made, done, occurring, etc., without method.  Seeming to be without purpose or direct relationship to a stimulus. Oxford English Dictionary

A simple counterexample to your statement would be an error-proof logical circuit built out of noisy components.

I don't know if this is off-topic, but when I think of randomness, I'm inclined to think in cosmological terms. If we can find a formalised version of this, < https://medium.com/intuitionmachine/there-is-no-randomness-only-chaos-and-complexity-c92f6dccd7ab >, I can write an answer. My link is a bit to close to a blog post for my taste. Best wishes to you OP.

@TautologicalRevelations I just finished the article--thanks for that.  An answer summarizing the points made in the article would be a good answer.  Certainly it's a fresh perspective that may get to the root of the question!

That sounds reasonable. Unfortunately, quantum chaos is a technical topic. All the best!

[@DukeZhou] I have written a complete answer to this question. Best wishes.

There might be a neuroscience/biology angle (still related within A.I.), for this question about: randomness; and decision making and logic. However, I am not qualified to write about it.

Fuzzy logic is a potential bridge between formal logic and randomness. Consider: Does fuzzy logic reduce uncertainties and multi-variate logics (yes, I used a plural form of an uncountable) to binary logic via the interface of Boolean Algebra? If there is an interest in this, I shall consider writing another answer in this style.

I think the answer here lies in that the dictionary definition of randomness you have is not the one used in statistics, ML, or mathematics. We define randomness to mean there exists a distribution with generally greater than 0 uncertainty.
Depending on who you talk to, we live in a random universe (the way we define quantum mechanics depends on a wave function (essentially a probability distribution)
So why if a sequence is drawn from a distribution is it illogical? First, even as humans we can make a strong argument that what we say is random. I mean we speak to convey some form of message or context, but there exists multiple ways to deliver this, but we choose a single one. Our brains inherently model $p(\vec w|c)$ where $\vec w$ is the sequence and $c$ is our context or message we want to convey.
Takeaway: Generating a sequence in an ergodic or uniform manner would be illogical, but that is not what is being modeled or done in practice. Normally its drawn from some complex distribution.
Sidenote: My above claim could make it seem that being uniformly random implicates something illogical, and I want to emphasize that is not the case. It is domain to domain, sometimes that is the most logical solution, just in the case of sentence generation it normally isnt. I would define a logical algorithm as one that given the information at hand acts in a sensible manner towards achieving some goal, and so if something purely random does that, I don't see the problem.

Good answer.  I intentionally restricted my definitions largely to computational logic.  There has been some inquiry into the role of quantum phenomenon (probability distributions in general) and "mind", so I'm pondering the link and role of stochasticity.  For instance, can there truly be choice in a purely deterministic system?  (Yes and no?)

For instance, two deterministic algorithms can be playing a non-trivial abstract game.  Where the decision making process is of the competitor is unknown, indeterminacy arises.  Yet the decision making process is fully deterministic, so the algorithms don't have "choice" in the sense that the decisions will be the same for a given game state.

I might misunderstand your question, but there seem to be different levels of logic at play here.

Computing logic, whereby any computational process is based on processor logic. In this case, any computing is involving logic, as boolean logic drives any processing.
Linguistic logic, where there is a logic in the sequencing of sentences within a text. A random collection of sentences is not a text, as there need to be certain principles behind the structure to make it a narrative.

While you can easily generate a sequence of random sentences, they will not mean anything; there won't be any logic behind selecting a particular sentence to follow on from another one. So this is linguistic logic rather than processing logic. Note that where the linguistic logic is makes it a bit vague: I can read a randomly selected sequence of sentences and ascribe meaning to it by building a mental model that treats it as a logically constructed text. This principle is what made ELIZA so successful: even though the program's answers were based on simple pattern matching rules with no understanding, many users assumed there was logic/meaning behind it and interpreted it as such, papering over the cracks in the conversation.
In summary: there is logic involved in random sentence combining, but it is the low-level computing logic, not the higher-level linguistic interpretative logic, which is generally absent from randomly generated data.

In certain games, random selection is the optimal strategy.  See: Matching Pennies
Strategy is essentially a plan of action utilized to achieve a goal.

If random choice can be a strategy, it seems that it must be a form of logic, even if the nature of the stochastic process is counter to all forms of formal logic.

This seems paradoxical, in that the random strategy is to have no strategy (random choices.)

As I mentioned in my answer being purely random is not illogical in certain cases— where are you seeing the paradox to formal logic?

@mshlis it seems like stochasticity has no role in formal logic, but is utilized in computational logic.  I've been doing some linguistic and semantic research, trying to get at the roots of these concepts.

why do you say no role? Where is that coming from?

@mshlis Formal logic seems to involve truth statements and inference.  Randomness seems to throw a wrench into these gears.

even if that is all that defined formal logic (very arguable), still not seeing the relation to how randomness throws a wrench in that

@mshlis how can you follow a strict set of arguments to reach a "true" conclusion if parts of that process are random?  Moreover, how can you infer when the result is unpredictable?

distribution in leads to distribution out. Only when you observe do you get a definitive output (similar to collapse in quantum mech)

No argument there.  You could arrive at a "If A then X; if B then Y", but the truth is dependent on a random event, and variable.

Yes, and as you described formal logic requires truth statements and inference, you can achieve both with that distribution

i feel this is extending past what a comments section can be, if you want this can be continued in a chat

@mshlis Agreed, but is it strictly logical?  Where the probability is 50/50, both outcomes are equally true.  Logos seems distinct from probability, even if logic is used to predict outcomes accurately.

Let us continue this discussion in chat.

Let me add an example from machine learning that shows that resorting to randomness is the optimal way, sometimes.
When working on the whole data is not tractable (computation cost, data does not fit in memory), working on random samples can be an optimal way to train a machine learning algorithm. One of the most used optimization technique in those cases is the Stochastic Gradient Descent.
It is an iterative procedure that computes the estimates of the true gradient of the loss function that needs to be minimized, over a randomly selected data point from the whole data. After getting the gradient estimate, the weights are updated, all this done by the well known back-propagation algorithm. This procedure is repeated many times until a stopping criterion.
The rule is:
$ \theta_{k+1} \leftarrow{} \theta_{k} - \eta_k \nabla (f_{i(k)}(x_k))$
where $\theta$ are the weights of the network, $f$ is the loss function whose gradient is computed w.r.t the weights of the network,   $x_k$ is the randomly chosen sample to compute gradients for, and $\eta_k$ is the step size to multiply the negative of the gradient with.

How is this related to the question "Is randomness anti-logical?"? SGD can indeed be related to this question, but you're not explaining or emphasizing how or why.

@nbro This answers points to the fact that working on random samples can be an optimal way to train a neural network, when working on the whole data is not tractable. Basically the answers is on the lines of - randomness is not anti-logical, with a counter-example to the statement in the question.

Just edit your answer to include these details. If someone is not familiar with GD, they will not understand your answer. You should say that randomness is not necessarily anti-logical and that random actions can actually lead to the most optimal (thus logical?) solution. This is actually a good answer, if you add the details I've just mentioned. Along the same lines, you can also talk about $\epsilon$-greedy policy in Q-learning, if you are familiar with it.

@nbro Edited the answer. Hope it is more understandable now. Thanks

Previous answers are very well written. I just wanted to supplement the thread by giving a simple example. The example shows how a logical function can be computed without errors using noisy components.
Taken verbatim from Neural Networks by Raul Rojas. An excellent book:

an example of a network built using four
  units. Assume that the first three units connected directly to the three bits of
  input $x_1, x_2, x_3$ all fire with probability $1$ when the total excitation is greater
  than or equal to the threshold $\theta$ but also with probability $p$ when it is $\theta − 1$.
  The duplicated connections add redundancy to the transmitted bit, but in
  such a way that all three units fire with probability one when the three bits
  are $1$. Each unit also fires with probability $p$ if two out of three inputs are $1$.
  However each unit reacts to a different combination. The last unit, finally, is
  also noisy and fires any time the three units in the first level fire and also with
  probability $p$ when two of them fire. Since, in the first level, at most one unit
  fires when just two inputs are set to $1$, the third unit will only fire when all
  three inputs are $1$. This makes the logical circuit, the AND function of three
  inputs, built out of unreliable components error-proof.

Central Premises:--
This, computability of randomness in conjunction to logic, is unfortunately/fortunately a very technical topic.

" ... That stochastic process is part of an algorithm, which is a set of instructions that must be valid for the program to compute.
... Is randomness anti-logical?" ~ DukeZhou (Stack Exchange user, opening poster)

This answer is about: randomness and chaos; and how they relate to logic and computability.

"What is randomness and where does it come from?
  This is one scary place to venture in. We take for granted the randomness in our reality. We compensate for that randomness with probability theory. However, is randomness even real or is it just a figment of our lack of intelligence? That is, does what we describe as randomness just a substitute for our uncertainty about reality? Is randomness just a manifestation of something else?"
  — "Medium." Medium, < medium.com/intuitionmachine/there-is-no-randomness-only-chaos-and-complexity-c92f6 >.

-

"Many natural intensional properties in artificial and natural languages are hard to compute. We show that randomized algorithms are often necessary to have good estimators of natural properties and to verify some specific relations. We concentrate on the reliability of queries to show the advantage of randomized algorithms in uncertain cognitive worlds." — de Rougemont, Michel. "Logic, randomness and cognition." Logic, Thought and Action. Springer, Dordrecht, 2005. 497-506.

Layperson's Explanations:--
Unfortunately, quantum chaos in relation to randomness, is a profoundly technical topic. I have managed to track down sources that relatively aren't overly technical.
As a starting point, this Wikipedia article is worth reading:--
(https://simple.wikipedia.org/wiki/Chaos_theory)
You can continue and read this particular Medium post:--
(https://medium.com/intuitionmachine/there-is-no-randomness-only-chaos-and-complexity-c92f6dccd7ab)
For profoundly technical topics, I recommend this book series, as they are written by experts in basic technical terms, for the laypersons wanting to study technical topics:--
(https://en.wikipedia.org/wiki/Very_Short_Introductions)
I recommend reading:--

Chaos: A Very Short Introduction
Probability: A Very Short Introduction
Fractals: A Very Short Introduction

Other References for the Layperson:--

(https://www.random.org/randomness/)
(https://plato.stanford.edu/entries/computability/)
(https://plato.stanford.edu/entries/chance-randomness/)
(https://plato.stanford.edu/entries/qt-quantlog/)

Some broader implications of chaos [Link to Stanford Encyclopedia of Philosophy].
When I think of randomness, I'm inclined to think in cosmological terms. Is randomness is a structural property of the universe? Is anything in the universe truly random?

Technical Explanations:--

"In mathematical logic, independence is the unprovability of a sentence from other sentences." Wikipedia contributors. — "Independence (mathematical logic)."  Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 3 Feb. 2019. Web. 29 Aug. 2019.

-

"We propose a link between logical independence and quantum physics. We demonstrate that quantum systems in the eigenstates of Pauli group operators are capable of encoding mathematical axioms and show that Pauli group quantum measurements are capable of revealing whether or not a given proposition is logically dependent on the axiomatic system. Whenever a mathematical proposition is logically independent of the axioms encoded in the measured state, the measurement associated with the proposition gives random outcomes. This allows for an experimental test of logical independence. Conversely, it also allows for an explanation of the probabilities of random outcomes observed in Pauli group measurements from logical independence without invoking quantum theory. The axiomatic systems we study can be completed and are therefore not subject to Gödel's incompleteness theorem." Paterek, Tomasz, et al. "Logical independence and quantum randomness." — New Journal of Physics 12.1 (2010): 013019.

-
Other Technical Explanations, Sources, References, and Further Reading:--

(https://iopscience.iop.org/article/10.1088/1367-2630/12/1/013019/meta)
(https://en.wikipedia.org/wiki/Quantum_chaos)
(https://arxiv.org/pdf/0708.1362.pdf)
(https://arxiv.org/pdf/1701.01107.pdf)
(http://csc.ucdavis.edu/~cmg/papers/idep.pdf)
(https://www.datasciencecentral.com/profiles/blogs/logistic-map-chaos-randomness-and-quantum-algorithms)
(https://www.deepdyve.com/lp/wiley/non-linear-dynamics-complexity-and-randomness-algorithmic-foundations-9vxIJOTT6u)
(https://en.wikipedia.org/wiki/Independence_(mathematical_logic))

Notes:--

I usually do not use Medium or Quora as a source, with some exceptions. I have  chosen to do so here.
I've decided to place Stanford Encyclopedia of Philosophy sources in the layperson's section.

This answer really doesn't touch upon the question. It is a bunch of links. I would say please elaborate on the central idea that you want to convey, which would make this a valid answer.

Okay. If you have any other suggestions as to how formalised information should be communicated, then please say so. Let's work out the issue like rational adults. :) :D

There is no issue that needs to be worked out. Pay a visit here.

A certain improvement. If you could elaborate more on -- Randomness is a structural property of the universe. -- the answer would surely become better.

"There is no issue that needs to be worked out." ~ naive, user.
Then I don't need to do anything?

"A certain improvement. If you could elaborate more on -- Randomness is a structural property of the universe. -- the answer would surely become better." ~ naive, user.
I see. I've made changes.

Let's avoid extended discussions in comments. I wish you the best.

Thank You! I appreciate your wish. I believe that this answer could be improved to great potential so just a nagging piece of advice. Please take all the time in the world to frame the answer to any question. I see that you have a lot of materials listed in the answer. And I really appreciate it. So, kindly try to make the answer more coherent by weaving together the ideas/concepts that you want to convey--I say this because there are a few potentially great ideas  floating and increasing the entropy of the answer -- then it will surely make this answer a great addition to this thread.

@naive As OP, I specifically solicited this answer because it addresses what might the root of the question--is there true randomness.  (This is a raging debate, as Bell's Theorem is sound, but many still hold that indeterminacy is merely a function of emergence and "factors beyond observation or calculation".)

Let me know if any further changes are needed. I'm glad we could work this out. Best wishes.

I did some research. Stockholm statistics involves a lot of R&D and data mining. Despite this, I made adjustments and improvements based on naive's (user) suggestions and here < https://ai.stackexchange.com/help/how-to-answer>, for my future answers: < https://philosophy.stackexchange.com/a/65763/30380 >. Best wishes.


text:
Is it possible to teach an AI to edit video content?
Every week I will get a lot of videos from a game that I play, outside the game where you throw wooden skittle bats at skittles, and then I will cut videos, so that, at the end. there is video only about throws.
The job is simple and systematic. I have a lot of videos, so I was wondering:

Is it possible to teach AI to cut videos from the right place?

I was thinking to ask help or guidance where to start to solve this problem.
I can't use only sound, because sometimes you can hear skittles hit from outside of the video.  I also can't just use movement activity, because sometimes there are people moving around the field. Videos are always filmed from a fixed stand, so it should make it easier. So, is it possible and where to start?
Here is another example: https://www.youtube.com/watch?v=sHu6yMBV3xU

Hi and welcome to this community! Let me try to understand your problem. You have a lot of videos while people are playing a certain game. So, you want to create an AI that edits your videos so that you have only the parts related to the "throws". You're saying that you can't use only the sound and the movement in the videos to train an AI, because it might not learn the expected patterns. Is this correct?

The general rule of thumb is if a human could identify it with no problem, normally an AI can be trained to somewhat succeed. This sounds like there are some very simple and easily recognised identifying features (rapid movement of a limb, bright colour moving) so if I had to say, I would think an AI would be able to do this task with relative ease. As to how you program it is up to you.

@Recessive This is just what I thought. Some thing like this. I'm just wondering where to start this project.@nbro The sound and movement can help to find the right spot, where to cut, but they can't be the onlyones that triggers AI to cut video.

@pinq I've never doe anything with a video before, so I'm not sure where you would start. As a guess, I would look in to RNN's, probably LSTM's (as you will want to analyse a bunch of frames, say every 10th frame or something, every frame would likely take too long) mixed with a CNN. Look up projects people have done for feature recognition in videos before to get a grounding.

@pinq- This is a very exciting problem indeed. +1

The real question is how many millions of dollars and dozens of years can you afford for achieving your goals. See http://norvig.com/21-days.html & the mythical man month. But I saw several research papers about your topic

I believe the answer is yes, but the video edition is mostly programmatic. The AI part comes with detecting the right spots to cut.

You want to detect the right portion when someone picks a wooden skittle
you want to detect when the Skittles stop moving on the ground (to detect this, also when they start moving)

These will give you timestamps on the video. The next step is to add some padding and run the drop-down frame operations in the video, which can all be done with a simple script.
You might find this video very similar in concept, and maybe even as code source: https://youtu.be/DQ8orIurGxw
For the recognition of the objects in the video frames, there are lots of options. You might look into computer vision or object motion detection.

Yeah, I think this is the right way to proceed. You are right, I dont' need IA to "cut" it, but just to learn those two thing( picks skittle and stop moving). Have to start learn how to teach AI to recognize those.

@pinq- I'm glad to be of help. Depending on your level of knowledge you might want to train your own model or use existing products. Azure, Google Cloud and Amazon Web Services all provide great tools for AI development.

I'm thinking, you can input the video you are trying to edit and make it output the timestamps to cut. You will probably have to manually type in the timestamps that you would cut for that video, or maybe a keylogging program of some sort.
This works in theory, kinda, but I'm not sure how exactly though. The inconsistent input length is easy enough to deal with, but I'm pretty sure you cant have inconsistent output lengths (otherwise I would be using it long ago). Maybe just make like 100 nodes and make it output (timestamp, confirm) where if confirm is > 0.5 it is an actual cut it wants to make.
But inputting whole videos is never a good idea. It takes way too long and takes like 30 gigs of RAM(I had to use virtual RAM which is ridiculously slow) for like a 5 min video and crashes all the time. Any suggestions though?


text:
Can we combat against deepfakes?
I came across 'Amber'(https://ambervideo.co/) where they are claiming that they have trained their AI to find patterns emerging due to artificially created videos which are invisible to naked eye.
I am wondering that the people who are creating deepfakes can as well their AI's to remove these imperfections and so the problem reduces to 'cat-mouse' game where having more resources(to train their AI) is more crucial.
I do not work in AI and vision and so I may be missing some trivial points in the area. I would really appreciate if detailed explanation or relevant resources are given.
Edit: Most of the people who do manipulate the media news or create fake news could afford more resources than an average citizen. So, is the future is really going to be dark where only few strong have even more control on the society than today?
I mean even though there are fake photos created by photo shop, most of the good photo-shopped photos do take a long time to make. But if AIs can be trained to do that then it is more about having large resources. Are there related works which give hope to know real from fakes?
P.S.: I realize that after the edit, the question also went tangential to the topic-tags here. Please let me if there are relevant tags.

Yes, it will become a cat and mouse game

I think this game will go pretty crazy, because, at some point, the generator AI will be able to generate absolutely perfect images. Actually, no, just perfect enough that no AI can be sure whether they are real or fake.
So, I think the AI war will go onto more than the image, the detector AI will probably evolve to analyze whether this video is logically plausible, for example, by tracking the celebrities' position to prove that it is impossible that he/she was, for example, let's put it this way, being unloyal to his/her partner.
I mean, currently, AI can tell whether an image is fake or not better than human because it has seen about a million times more samples than us, but if we know who the person in the image is and we are as stalky as the AI I just described, we can probably work out that this image is implausible.
Of course, there will be counter measurements to that. But, at that point, we might as well just let the AI rule the world, given that it will have become this smart (lol).
But, seriously, if it's smart enough to think this far ahead in this 'real world' problem, then strong AI is nigh.

As mshlis begins to touch on, yes we can. However, it will be an unending war. There are quite a few reasons for this. For one, the problem itself is not simple. There are many different 'versions' of the deepfakes framework out in the wild at this point, any algorithm you create to try and spot them would have to work for all of the different iterations. Another reason is the systems that would be used to combat it can be quite easily fooled(see).
However, the most glaring, and unending problem comes from the architecture itself. Let us say we create a perfect algorithm that is foolproof and extremely accurate. Even then, all one would have to do is use that algorithm as the discriminator during training of your deepfakes model, and bing-bang-boom, your deepfake detection model is busted.

@DuttaA in this case we would be using the “perfect” discriminator, or the one that can tell it’s a deepfake, as the discriminator to train the new generator. Apologies if that was unclear

@DuttaA, yea sorry again, I am rambling there wrt an algorithm that would accurately predict whether a given input was a deepfake. We then would plug that into our architecture as the discriminator for our deepfakes generation. Edited it to hopefully make it a bit more clear(some things sound simpler in one's head)

Sound and image manipulation necessarily creates artifacts.  Around the edges of superimposition in layers there are such.  Face replacement and other more surface or object centered operations create a different class of artifacts.  A sufficiently well constructed LSTM or GRU network and data set of manipulated frame sequences and the user (mouse and keyboard) events that manipulated them can be used to produce good guesses of the event set from new images.  Adding unmanipulated images to the data set can allow for the no-event case.  That would be the supervised way to do it.  There are unsupervised approaches that would require considerably less training resources, which is likely the case with this San Francisco solutions provider.
In either case, the question of escalation is a good one.  One can also create a device, building from the current state of machine learning, that hides manipulations from existing detection software.  If they are forward thinking, the same provider may have already developed it.

Can we combat against deepfakes? ...
  I am wondering that the people who are creating deepfakes can as well their AI's to remove these imperfections ...

Yes and yes.  In war, the combatants learn the methods of the opposing combatants and adapt.  A detection mechanism for opposing strategy changes is also theoretically possible, which is one of the reasons that military research facilities spend so much on higher forms of AI.
The edit to the question is not entirely tangential either.
If we propose, which some people have, that a virtual reality may damage human culture or individual psyches, the average citizen is likely to be considered collateral damage on the field of combat by companies seeking a good financial return from their AI development.  Of course, we could say the same thing about the use of diminished fifths in music.  Two notes that are six half steps apart produce a dissonant frequency ratio of $1:\sqrt{2}$.  The diminished fifth was considered subliminally satanic in Europe centuries ago and prohibited in music compositions by law.  The glass harmonica was alleged to have driven listeners insane.
Anthropologically, it is possible that a mark of our species is to manipulate appearance.  To hunt fakes in frames and audio is likely a fruitless hunting ground, with our without the escalation.  The current hunting ground of import is the research into what genetic elements led to human abilities to imagine, design, and fabricate.  After that is known, we may have a better window into whether the cat-and-mouse games we play have any sustainable value for our species going forward.  Those who love competition believe that it strengthens, which is possible.  It is also possible that the games are solely an artifact of a painful path to our emergence as the dominant mammalian species and no longer of any particular use.  "Do to others as you would want them to do to you," has the ring of truth we can't ignore either.
If we look through this wider lens, we can see that our entertainment choices tend toward what could (in the absence of bias) qualify as deepfakes.  There are entire cities fueled by the money made by the entertainment industry producing excellence in sound and image capture, synthesis, and manipulation.  The story lines are not necessarily representing deep truths.  This is more overt.
On the more covert side, some pass fakes off as reality as a move in their own game to achieve some objective, but this is not the exception in our culture.  The fields of public relations and marketing are based on the creation and preservation of business value.  Some elements of government, education, and community are based on the creation of economy-preserving beliefs.  The intention may be to benefit others or beat them and gain personal wealth.
Some of us seek authenticity and would like the fake-finders to win the combat, but it appears they may be on the losing side.
Does this question and this answer pertain to this Stack Exchange community?  Absolutely.  This community's description in the drop down of SE communities reads, "For people interested in conceptual questions about life and challenges in a world where 'cognitive' functions can be mimicked in purely digital environment."  Whether AI ultimately weighs in on the side of playing people or informing them certainly pertains to this published view of this community's purpose.


text:
How do you scale your ML problems?
While I have limited resource usually to train my machine learning models, I often find that my hyperparameter optimization procedure is not necessary using all my GPU and CPU, and that is because the results also depend on the batch size in my experience.
If you find in your project that a low batch size is necessary, how do you scale your project? In a multi-GPU scenario, I could imagine running different hyperparameter settings on different GPUs, but what other options are out there?

Hi and welcome to this community. It is not clear what you're asking. If you find in your project that a low batch size is necessary, how do you scale your project? What do you mean by "scale your project"? What is the relation between low batch size and scalability? IMHO, it is not very clear, in general, what you're asking. Are asking if there are any alternatives to hyper-parameter optimisation that runs on different GPUs? If yes, I could simply say: run the hyper-parameter optimisation using only one GPU. However, this is not what you're looking for, so be more specific and precise.


text:
Machine learning methods to identify the recipient of a document?
I need some advice on what AI methods would be suited to the identification of a recipient of a document, where the format of the documents may vary.

there are different letter format we can input that PDF extract text from that PDF

High-level, this sounds like it could be a legit task for a learning algorithm, in that there may be great variance in how human to human correspondence is structured.  (Should be an easy, rules-based solution for formal correspondence, but what about informal?  Is this within the scope of the project?)

I want to train ml or AI for identify the recipient of any business document


text:
Deep Q-Network (DQN) to learn the game 2048
I am trying to build a Deep Q-Network (DQN) agent that can learn to play the game 2048. I am orientating myself on other programs and articles that are based on the game snake and it worked well (specifically this one).
As input state, I am only using the grid with the tiles as numpy array, and as a reward, I use (newScore-oldScore-1) to penalize moves that do not give any points at all. I know that this might not be optimal, as one might as well reward staying alive for as long as possible, but it should be okay for the first step, right? Nevertheless, I am not getting any good results whatsoever.
I've tried to tweak the model layout, the number of neurons and layers, optimizer, gamma, learning rates, rewards, etc.. I also tried ending the game after 5 moves and to optimize just for those first five moves but no matter what I do, I don't get any noticeable improvement. I've run it for thousands of games and it just doesn't get better. In fact, sometimes I get worse results than a completely random algorithm, as sometimes it just returns the same output for any input and gets stuck.
So, my question is, if I am doing anything fundamentally wrong? Do I just have a small stupid mistake somewhere? Is this the wrong approach completely? (I know the game could probably be solved pretty easily without AI, but it seemed like a little fun project)
My Jupyter notebook can be seen here Github. Sorry for the poor code quality, I'm still a beginner and I know I need to start making documentation even for fun little projects...
Thank you in advance,
Drukob
edit:
some code snippets:
Input is formatted as a 1,16 numpy array, also tried normalizing the values or using only 1 and 0 for occupied and empty cells, but that did not help either. Which is why I assumed it's maybe more of a conceptual problem?
    def get_board(self):
        grid = self.driver.execute_script("return myGM.grid.cells;")
        mygrid = []
        for line in grid:
            a = [x['value'] if x != None else 0 for x in line]
            #a = [1 if x != None else 0 for x in line]
            mygrid.append(a)
        return np.array(mygrid).reshape(1,16)

The output is an index of {0,3}, representing the actions up, down, left or right and it's just the value with the highes prediction score.
prediction = agent.model.predict(old_state)
predicted_move = np.argmax(prediction)

I've tried a lot of different model architectures, but settled for a simpler network now, as I have read that unnecessary complex structures are often a problem and unneeded. However, I couldn't find any reliable source for a method, how to get the optimal layout except for experimenting, so I'd be happy to have some more suggestions there.
model = models.Sequential()
        model.add(Dense(16, activation='relu', input_dim=16))
        #model.add(Dropout(0.15))
        #model.add(Dense(50, activation='relu'))
        #model.add(Dropout(0.15))
        model.add(Dense(20, activation='relu'))
        #model.add(Dropout(0.15))
        #model.add(Dense(30, input_dim=16, activation='relu'))
        #model.add(Dropout(0.15))
        #model.add(Dense(30, activation='relu'))
        #model.add(Dropout(0.15))
        #model.add(Dense(8, activation='relu'))
        #model.add(Dropout(0.15))
        model.add(Dense(4, activation='linear'))
        opt = Adam(lr=self.learning_rate)
        model.compile(loss='mse', optimizer=opt)

Could you give details in the question, how you are representing the input? Are scaling it in any way? Please give small snippet of relevant code if that makes it clear (don't expect anyone will read your whole notebook just to find problems for you). use [edit] to add details. Another common mistake could be in how you are representing the output - what is your output layer, is it multi-action or single action, have you added any non-linearity?

Could you explain what you mean with multi-action or single-action? My output is just a 1-D Vector with four values for the four possible actions (up, down, left, right) of which the highest value will be taken and this action is then performed.

That's what I'd call multi-action. The NN outputs a value for each possible action, given a state, all at once. The alternative would be to model $Q(s,a): \mathcal{S} \times \mathcal{A} \rightarrow \mathbb{R}$ directly, with input of state and action representation concatenated, and output a single value.


text:
Can Machine Learning make economic decisions of human quality or better?
Basically, economic decision making is not restricted to mundane finance, the managing of money, but any decision that involves expected utility (some result with some degree of optimality.)

Can Machine Learning algorithms make economic decisions as well as or better than humans?

"Like humans" means understanding classes of objects and their interactions, including agents such as other humans.
At a fundamental level, there must be some physical representation of an object, leading to usage of an object, leading to management of resources that the objects constitute.
This may include ability to effectively handle semantic data (NLP) because mcuh of the relevant information is communicated in human languages.

I think I know what your getting at, but this question needs editing.  Economic decision making is not restricted to the field of finance, but involves any decisions with expected utility.  Thus, minimax can be applied to a range of problems not involving mundane finance.  I've attempted an edit of the question.

ok, i can specify. nexoma has already answered in the direction it want

this is a trick - humans mind is complete, means has limited set of "parameters" , but can handle infinite about of combinations of them. i just wonder why realy no project exists about that. local success if false success

It has never been demonstrated that the human mind can do infinite calculations.  (If it were so, many would be interested in how!)

Updated my answer--I think Google's harnessing of Machine Learning to manage the air conditioning in it's data centers may apply.

why did not they choose something more interesting to show that

The point with the air conditioning application wasn't to be interesting, it was to generate a more optimal economic outcome--spending less energy to operate the data centers.

Consider managing a memory structure as an economic function.  (Where to put, and how to manage, the resources constituted by data.)  This is something computers can do better and faster than any human.  The reason is that the system in which the economic decisions are being made is fully defined.
Routing of packages is a similar, economic function that computers do much better than humans.
These functions haven't been handled by Machine Learning in the past, but, soon after the AlphaGo milestone, Google found an economic application for Machine Learning.  Google's DeepMind trains AI to cut its energy bills by 40% (Wired)
So it's entirely context dependent.
As the model increases in complexity and nuanced, utility will be reduced. (In the former case it's a time and space issue related to computational complexity, and in the latter case, often a function of incomplete information or inability to define parameters.)
But as the sophistication of the machine learning algorithms increases, and the models continue to be refined, the algorithms will get better and better at managing intractability and incomplete information.

at this time, as open source - NOT.
i guess:

for a decision make we need a broad input layer/-s of data flows,
we need a 20 000-200 000 layers of neural networks or more complex and dynamic architectures
we need a deep research of date-time influence for historical data flow

what we have at this time:

only sensors - opencv and object recognition, nlp-tagging, data predicting

so, sensors isn't AI, sensors and machine learning is previous experience. it is not ready for the change analysis.

why so many layers? also as i input may be also feedback from humans. And yes, i think there will be need some advanced architectures, not straight feed forward as we know today- But it will be real project with usefull value, not regognizing cats and dogs, whatever

https://en.wikipedia.org/wiki/Ilya_Sutskever was saying that  the network with 10000 layers may understand grammar, may be!

maybe he  over-estimates that a little bit, if an 8 layer stuff can recognize a dog.

@user8426627 Grammar is substantially more complex than image recognition (easily confused image recognition) but I do agree the 20k-200k figure seems a little like it was plucked out of thin air.

yes, but it's only dog/cat with the 28x28-pixel input. so for economic decision you need summarize a economic theory books, economic news, many economic  reports and many politics and many others in manufacturing, geology, climat, states, human factor as leaders decisions. it's more broad than the 28 pixel machine learning.  2 input bits have 64 states based on 16 boolean logical funstions. 2^(2^N). and you need 4 bits for choice a function.

sorry, N^(2^2), where N - input bits. AND IS IT ONLY FOR ONE OUTPUT BIT!


text:
Are simple animal snares and traps a form of automation? Of computation?
I'm trying to understand the relationship of humans and automation, historically and culturally.
I ask because the waterclock is generally considered the earliest form of automation, but snares and deadfall traps constitute simple switch mechanisms.
(They are single use without human-powered reset, but seem to qualify as machines. The bent sapling that powers the snare is referred to as the engine, which is "a machine with moving parts that converts power into motion.")
If snares and traps are a form of automation, automation has been with us longer, potentially, than civilization.

Are simple animal traps a form of automation or computation?

How to make a simple snare (the Ready Store)

Paiute Deadfall Trap (Homestead Telegraph)

Absolutely these traps and snares are a form of automation.

They take a task--harvesting small animals--which was traditionally done by hunting them, and make the process automatic.  The mechanism requires a human to set up, but its function is automatic.  This is to say that the mechanism operates without human involvement.

Absolutely this is a form of computation.

As DuttaA observed, these machines utilize a simple "IF/THEN" statement.  In the case of the snare:

IF the hook is displaced from the base, THEN the sapling straightens

These simple machines will also return True or False:

TRUE: The trap catches an animal
  FALSE: The trap is sprung but empty

The small animals are the input and, potentially, the output, depending on whether the mechanism returns "true".
(The use of "true" has historically included phrases such as "their aim was true" in the sense of shooting an arrow or throwing a spear.)


text:
Does it matter if it's a bot or a human generating text? Doesn't it come down to the content?
It was noted today that automated text generation is advancing at a rapid pace, potentially accelerating.
As bots become more and more capable of passing turing tests, especially in single iterations, such as social media posts or news blurbs, I have to ask:

Does it matter where a text originates, if the content is strong?

Strength here is used in the sense of meaning.  To elucidate my argument I'll present an example.  (It helps to know the Library of Babel, an infinite memory array where every possible combination of characters exists.)

An algorithm is set up to produce aphorisms. The overwhelming majority of the output is gibberish, but among the junk is an incredibly profound observation emerges that changes the way people think about a subject or issue.

Where the bot just spams social media, the aphorism in question is identified because it recieves a high number of reposts by humans, who, in this scenario, provide the mechanism for finding the needle (the profound aphorism) in the haystack (the junk output).
Does the value of the insight depend on the cognitive quality of the generator, in the sense of having to understand the statement?
A real world example would be Game 2, Move 37 in the AlphaGo vs. Lee Sedol match.

I would say it depends on the amount of content. If an algorithm is stochastic, patterns may be discernible over a large enough data set which could pose a problem. It also depends if the bot is actively learning. Say you got a human to make 500000 GO moves, as humans are always actively learning, it's unpredictable as their previous moves will have an affect on future moves, where as alphaGO is already trained, and so should make the same decisions every time (unless some random element was thrown in, in which case it should be stochastic)

sometimes voice pitch also matters(and system designers forget about that) - if system is badly designed then you will feel that it is a bot, if design is great than you don't feel it's a bot at all

There are several aspects to this.
Firstly, content. I guess a further comparison would be to the monkeys on typewriters coming up with the complete works of Shakespeare eventually. You will probably have a huge mass of tedious text, with the odd nugget in it. One would hope that the signal-to-noise ratio would be better with human authors, though looking at Twitter that might not actually be the case (unless there are already more bots on there than humans!) Content evaluation/filtering is still an issue, especially with longer texts. How many computer-generated novels are there? Not as many as weather reports or news summaries.
Second, legal issues. Who 'owns' the text and is responsible for it? If a computer generates a text that incites violence, who is to blame for the consequences? The developer? Some texts require 'ownership', as they might have consequences attached to them. A wrong weather forecast that causes people to make wrong decisions, leading to loss of life. Do you sue the computer for that? So in this respect, clear responsibility is important.
So even if the content is good (point 1), there might also be responsibility (point 2) where it matters whether a text has been generated by an algorithm.

Assume it's not copyrighted formally, and the aphorism in question was discerned by a massive number of twitter retweets by humans.  (There has been a recent initiative to list an AI as an inventor on some patent applications, so we'll have to see how that plays out re: elements of personhood for artifacts that create!)  PS-Intentionality is what I was pondering after I asked this question--a big issue for AI ethicists is the idea that algorithms can't be meaningfully punished and so shouldn't be making impactful decisions. Thanks for your insightful answer.


text:
How to implement loss function of H-GAN model
I was trying to implement the loss function of  H-GAN. Here is my code . But it seem somethings wrong, maybe is recognition loss on z (EQ 9). I used the EQ 5 on MISO to calculate it. Here is my code:
def recognition_loss_on_z(self,latent_code, r_cont_mu, r_cont_var):
    eplison = (r_cont_mu - latent_code) / (r_cont_var+1e-8)
    return -tf.reduce_mean(tf.reduce_sum(-0.5*tf.log(2*np.pi*r_cont_var+1e-8)-0.5*tf.square(eplison), axis=1))/(config.batch_size * config.latent_dim)

And I calculated loss function:
    self.z_mean, self.z_sigm = self.Encode(self.images)
    self.z_x = tf.add(self.z_mean, tf.sqrt(tf.exp(self.z_sigm))*self.ep)

    self.D_pro_logits, self.l_x_real, self.Q_y_style_given_x_real, continuous_mu_real, continuous_var_real  = self.discriminator(self.images, training=True, reuse=False)
    self.De_pro_tilde, self.l_x_tilde, self.Q_y_style_given_x_tidle, continuous_mu_tidle, continuous_var_tidle= self.discriminator(self.x_tilde, training=True, reuse = True)
    self.G_pro_logits, self.l_x_fake, self.Q_y_style_given_x_fake, continuous_mu_fake, continuous_var_fake = self.discriminator(self.x_p, training=True, reuse=True)

    tidle_latent_loss = self.recognition_loss_on_z(self.z_x, continuous_mu_tidle,continuous_var_tidle)
    real_latent_loss  = self.recognition_loss_on_z(self.z_x, continuous_mu_real,continuous_var_real)
    fake_latent_loss =  self.recognition_loss_on_z(self.zp, continuous_mu_fake,continuous_var_fake)

And discriminator:
    def discriminator(self, x_var,training=False, reuse=False):
    with tf.variable_scope("discriminator_recongnizer") as scope:
        if reuse==True:
            scope.reuse_variables()
        conv1 = tf.nn.leaky_relu(batch_normalization(conv2d(x_var, output_dim = 64 , kernel_size=6, name='dis_R_conv1'),training = training,name='dis_bn1', reuse = reuse), alpha =0.2)
        conv2 = tf.nn.leaky_relu(batch_normalization(conv2d(conv1, output_dim = 128 , kernel_size=4, name='dis_R_conv2'),training = training ,name='dis_bn2', reuse = reuse), alpha =0.2)
        conv3 = tf.nn.leaky_relu(batch_normalization(conv2d(conv2, output_dim = 128 , kernel_size=4, name='dis_R_conv3'),training = training,name='dis_bn3', reuse = reuse), alpha =0.2)
        conv4 = conv2d(conv3, output_dim = 256 , kernel_size=4, name='dis_R_conv4')
        lth_layer = conv4
        conv4 = tf.nn.leaky_relu(batch_normalization(conv4, training=training, name='dis_bn4', reuse = reuse),alpha =0.2)
        conv4 = tf.reshape(conv4,[-1, 256*8*8])
        #Discriminator
        with tf.variable_scope('discriminator'):
            d_output = fully_connect(conv4, output_size=1, scope='dr_dense_2')
        with tf.variable_scope('dis_q'):
            fc_r = tf.nn.leaky_relu(batch_normalization(fully_connect(conv4, output_size=256 + config.style_classes, scope='dis_dr_dense_3'), training=training, name='dis_bn_fc_r', reuse=reuse), alpha=0.2)
            continuous_mu = fully_connect(fc_r, output_size=256, scope='dis_dr_dense_mu')
            continuous_var = tf.exp(fully_connect(fc_r, output_size=256, scope='dis_dr_dense_logvar'))
            style_predict = fully_connect(fc_r, output_size=config.style_classes, scope='dis_dr_dense_y_style')

        return d_output,lth_layer,style_predict,continuous_mu,continuous_var

Does anyone have experience with that, please tell me where I was wrong. Thanks you so much, I really appreciate that!


text:
How to detect LEGO bricks by using a deep learning approach?
In my thesis I dealt with the question how a computer can recognize LEGO bricks. With multiple object detection, I chose a deep learning approach. I also looked at an existing training set of LEGO brick images and tried to optimize it.
My approach
By using Tensorflow's Object Detection API on a dataset of specifically generated images (Created with Blender) I was able to detect 73.3% of multiple LEGO Bricks in one Foto.
One of the main problems I noticed was, that I tried to distinguish three different 2x4 bricks. However, colors are difficult to distinguish, especially in different lighting conditions. A better approach would have been to distinguish a 2x4 from a 2x2 and a 2x6 LEGO brick.
Furthermore, I have noticed that the training set should best consist of "normal" and synthetically generated images. The synthetic images give variations in the lighting conditions, the backgrounds, etc., which the photographed images do not give. However, when using the trained Neural Network, photos and not synthetic images are examined. Therefore, photos should also be included in the training data set.
One last point that would probably lead to even better results is that you train the Neural Network with pictures that show more than one LEGO brick. Because this is exactly what is required by the Neural Network when it is in use.

Are there other ways I could improve upon this?

(Can you see any further potential for improvement for the Neural Network? How would you approach the issue? Do any of my approaches seem poor? How do you solve the problem?)

Here is another project that tries to accomplish the same. https://github.com/deeepwin/lego-cnn

Did you guys push this idea to a consumable extent? I wouldn't mind to join.

Related: https://bricks.stackexchange.com/a/6124/132

So I am assuming that you are trying to detect a lego brick from the image. One idea is that you can use transfer learning. Leveraging a pre-trained machine learning model is called transfer learning. The underlying idea behind transfer learning is that one takes a well-trained model from one dataset or domain, and applies it to a new one.  François Chollet has written a very comprehensive guide to transfer learning (https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html)
I admit I took some of this information from Christopher Bonnett's article named Classifying e-commerce products based on images and text.
I also suggest using the Lego brick dataset from Kaggle on this link: https://www.kaggle.com/joosthazelzet/lego-brick-images
It has over 12,700 lego brick images.
If processing power is a problem, you can use Amazon Web Services for cloud computing. It is inexpensive for small scale operations like this.
Of course for the object detection, you can always increase the number of convolution layers. However, if you have too many layers, you should also include residual blocks/residual network. This would allow neural networks even with over a thousand layers to operate effectively. This video should help you understand how residual networks work (https://www.youtube.com/watch?v=ahkBkIGdnWQ)
Finally, make sure not to overfit during your training and if you do follow the residual network idea, you should also include upsampling in your convolution neural network( More in here: https://towardsdatascience.com/up-sampling-with-transposed-convolution-9ae4f2df52d0)
I hope this helped and good luck on your endeavor.